movieclip onRollOver onRollOut problem

  • as_newbie
  • Born
  • Born
  • as_newbie
  • Posts: 4

Post 3+ Months Ago

Hi everyone!

I am fairly new to the world of Flash and AS.

Right now, I am trying to make a slideshow that allows the user to rollover a movieclip. The movieclips are basically static pictures.

When a movieclip is rollover-ed (bad grammar i know!), the flash clip stops and onrollout it resumes again. Clicking on a movieclip goes to a URL using the getURL function.

right now only the first picture works when you rollover, rollout or click on the picture... the rest stay static and don't do anything...

here's what i am using for actionscript:

Code: [ Select ]
function doStop(){
_root.stop();
}

function doPlay(){
_root.play();
}

fxcm.onRollOver = doStop;
fxcm.onRollOut = doPlay;
fxcm.onRelease = function() {
    getURL("http://www.fxcm.com");
}

fxsol.onRollOver.stop();
fxsol.onRollOut = doPlay;
fxsol.onRelease = function() {
    getURL("http://www.fxsol.com");
}

gain.onRollOver = doStop;
gain.onRollOut = doPlay;
gain.onRelease = function() {
    getURL("http://www.gaincapital.com"); 
}

interactive.onRollOver = doStop;
interactive.onRollOut = doPlay;
interactive.onRelease = function() {
    getURL("http://www.interactivebrokers.com");
}

man.onRollOver = doStop;
man.onRollOut = doPlay;
man.onRelease = function() {
    getURL("http://www.manfx.com");
}
  1. function doStop(){
  2. _root.stop();
  3. }
  4. function doPlay(){
  5. _root.play();
  6. }
  7. fxcm.onRollOver = doStop;
  8. fxcm.onRollOut = doPlay;
  9. fxcm.onRelease = function() {
  10.     getURL("http://www.fxcm.com");
  11. }
  12. fxsol.onRollOver.stop();
  13. fxsol.onRollOut = doPlay;
  14. fxsol.onRelease = function() {
  15.     getURL("http://www.fxsol.com");
  16. }
  17. gain.onRollOver = doStop;
  18. gain.onRollOut = doPlay;
  19. gain.onRelease = function() {
  20.     getURL("http://www.gaincapital.com"); 
  21. }
  22. interactive.onRollOver = doStop;
  23. interactive.onRollOut = doPlay;
  24. interactive.onRelease = function() {
  25.     getURL("http://www.interactivebrokers.com");
  26. }
  27. man.onRollOver = doStop;
  28. man.onRollOut = doPlay;
  29. man.onRelease = function() {
  30.     getURL("http://www.manfx.com");
  31. }


my FLA file is available here:
http://www.sendspace.com/file/b5buso

i hope that one of you flash gurus can help me out!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

the code seems ok, except this line:
fxsol.onRollOver.stop(); -> should be just like the others: fxsol.onRollOver = doStop();
also make sure that all of your movieclips are instantiated on the stage. (Properties panel -> enter a name in the textbox below the movie clip name)
  • as_newbie
  • Born
  • Born
  • as_newbie
  • Posts: 4

Post 3+ Months Ago

hi icecold,

thanks for replying.

i made that change last night, and it still doesn't work. all movieclips have instance names.

could you perhaps check my FLA file at the link above to see what i am doing wrong?

this is kind of urgent.

thanks a lot!
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

oh my, is flash 8 and i only have MX ... but you can save as Flash MX and upload it again.
still i copy-pasted the code, then created the movieclips, placed them on the stage and it works just fine. don't know what exactly u did there.
  • as_newbie
  • Born
  • Born
  • as_newbie
  • Posts: 4

Post 3+ Months Ago

could you upload your source file so i can see what you are doing with your movieclips?

i have a feeling i'm doing something theoretically wrong.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

to be more exactly: the code remains the same, only with that line changed:
fxsol.onRollOver = doStop;
Then make sure you have all the movieclips on the stage, at the frame which has this action script. Also make sure your movieclips from the stage have the instance names (select a movieclip, goto property panel -> under movieclip combobox, enter it's name). Also make sure they all are the stage, in main timeline, and they are not nested in another movieclip.
fxcm, fxsol, gain, interactive, man -> these are the instances that you need to have at the frame with the actionscript.
  • as_newbie
  • Born
  • Born
  • as_newbie
  • Posts: 4

Post 3+ Months Ago

ah okay so you added actionscript at the beginning of each movieclip, so the other movieclips will read the actionscript from that frame!

Post Information

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