Scrolling menu/ button problem

  • nosdude
  • Born
  • Born
  • nosdude
  • Posts: 4

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • classified
  • Expert
  • Expert
  • User avatar
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

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. }
  • classified
  • Expert
  • Expert
  • User avatar
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

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..
  • nosdude
  • Born
  • Born
  • nosdude
  • Posts: 4

Post 3+ Months Ago

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
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

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 "
  • nosdude
  • Born
  • Born
  • nosdude
  • Posts: 4

Post 3+ Months Ago

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
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

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
  • classified
  • Expert
  • Expert
  • User avatar
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

good point .

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 15 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.