Scrolling menu/ button problem

  • nosdude
  • Born
  • Born
  • No Avatar
  • Joined: Jun 17, 2006
  • Posts: 4
  • Status: Offline

Post June 17th, 2006, 3:55 am

Hey everyone

I've got this horizontal scrolling menu (movie clip) made up of thumbnail images(buttons). The menu is set up with a mask layer to act as a window to the menu, and it scrolls left and right depending on the x location of the mouse. Everything about the scrolling works perfectly, except i cant get the buttons to respond to 'on release' 'goandplay' commands. Whats weird is the buttons do respond to my changes in the 'up, over, down, hit' instances.

this is the code i have on the movie clip:

mouseX = _xmouse;
menuX = menu._x;
if (mouseX>400) {
diff = (mouseX-400)/15;
}
if (mouseX<250) {
diff = (250-mouseX)/15;
}
if (mouseX<=200 && menuX<=600) {
setProperty("menu", _x, menuX+diff);
}
if (mouseX>=250 && menuX>=100) {
setProperty("menu", _x, menuX-diff);
}
if (menu._x>=600) {
menu._x = 600;
} else if (menu._x<=-150) {
menu._x = -150;
}
gotoAndPlay(21);



And this is the code on the button within the movie clip:

on (release) {
gotoAndPlay("30");
}


can anyone help? does what i wrote make sense?

thanks for the help
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 17th, 2006, 3:55 am

  • classified
  • Expert
  • Expert
  • User avatar
  • Joined: Dec 23, 2005
  • Posts: 540
  • Loc: Bahrain
  • Status: Offline

Post June 18th, 2006, 8:24 am

just to be more clear so u may get answers ...

Code: [ Select ]
mouseX = _xmouse;
menuX = menu._x;
if (mouseX>400) {
diff = (mouseX-400)/15;
}
if (mouseX<250) {
diff = (250-mouseX)/15;
}
if (mouseX<=200 && menuX<=600) {
setProperty("menu", _x, menuX+diff);
}
if (mouseX>=250 && menuX>=100) {
setProperty("menu", _x, menuX-diff);
}
if (menu._x>=600) {
menu._x = 600;
} else if (menu._x<=-150) {
menu._x = -150;
}
gotoAndPlay(21);


  1. mouseX = _xmouse;
  2. menuX = menu._x;
  3. if (mouseX>400) {
  4. diff = (mouseX-400)/15;
  5. }
  6. if (mouseX<250) {
  7. diff = (250-mouseX)/15;
  8. }
  9. if (mouseX<=200 && menuX<=600) {
  10. setProperty("menu", _x, menuX+diff);
  11. }
  12. if (mouseX>=250 && menuX>=100) {
  13. setProperty("menu", _x, menuX-diff);
  14. }
  15. if (menu._x>=600) {
  16. menu._x = 600;
  17. } else if (menu._x<=-150) {
  18. menu._x = -150;
  19. }
  20. gotoAndPlay(21);


And this is the code on the button within the movie clip:

Code: [ Select ]
on (release) {
gotoAndPlay("30");
}
  1. on (release) {
  2. gotoAndPlay("30");
  3. }
m0o , where <<Less is More>>
http://www.zainals.com
http://www.zainals.com/blog
  • classified
  • Expert
  • Expert
  • User avatar
  • Joined: Dec 23, 2005
  • Posts: 540
  • Loc: Bahrain
  • Status: Offline

Post June 18th, 2006, 8:28 am

oh yeah thats because you got the frame number Between " " .. remove them ... and give it a shot ..

Only frame names (strings) can be assigned between double quotes..
m0o , where <<Less is More>>
http://www.zainals.com
http://www.zainals.com/blog
  • nosdude
  • Born
  • Born
  • No Avatar
  • Joined: Jun 17, 2006
  • Posts: 4
  • Status: Offline

Post June 18th, 2006, 9:31 am

yes that code was correct, but the reason for those quote marks was because i tried to make it work by labelling the frame. I took the quote marks out but it still does not work?

Thanks for the help
  • classified
  • Expert
  • Expert
  • User avatar
  • Joined: Dec 23, 2005
  • Posts: 540
  • Loc: Bahrain
  • Status: Offline

Post June 18th, 2006, 11:06 am

so you are saying that the button receives on press events but not release ?

try targeting your Movie .. like

Code: [ Select ]
_root.gotoAndPlay(30);

//or if it was a nested Mocieclip ,

_root.nested_mc.gotoAndPlay(30) ;
  1. _root.gotoAndPlay(30);
  2. //or if it was a nested Mocieclip ,
  3. _root.nested_mc.gotoAndPlay(30) ;


try to put a trace statement Between the on(release) fucntion c if it actually getting that alright ...
Code: [ Select ]
on(release) {

trace(" Released " ) ;
}
  1. on(release) {
  2. trace(" Released " ) ;
  3. }


c if it outputs " Released "
m0o , where <<Less is More>>
http://www.zainals.com
http://www.zainals.com/blog
  • nosdude
  • Born
  • Born
  • No Avatar
  • Joined: Jun 17, 2006
  • Posts: 4
  • Status: Offline

Post June 18th, 2006, 1:06 pm

THANKS SO MUCH DUDE!

your root suggestion worked perfectly. Thanks for your help, i'm new to flash, i've been battling to find the solution to this for last couple days.

thanks again
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post June 20th, 2006, 9:13 am

just a reminder,
if you will ever load a flash movie that you created from another flash movie (called loader), dont use _root. in the loaded movie, since it will take the _root of the loader.
Instead, get used with this._parent
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • classified
  • Expert
  • Expert
  • User avatar
  • Joined: Dec 23, 2005
  • Posts: 540
  • Loc: Bahrain
  • Status: Offline

Post June 20th, 2006, 11:44 am

good point .
m0o , where <<Less is More>>
http://www.zainals.com
http://www.zainals.com/blog

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 41 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.