flash actionscript:
Hello friends! I am getting the following output in my Flash movie. You can see my Actionscript below. Can anyone please tell me what I am doing wrong? Thank you very much for your time and consideration! Kind regards, Greg Debugging Output: Level #0: Variable _level0.$version = "WIN 6,0,21,0" Variable _level0.randomImage = [function 'randomImage'] Variable _level0.fadeImages = undefined Movie Clip: Target="_level0.imageHolder" Frame 1 of Timeline: stop(); fadeImages = setInterval("randomImage",3000); function randomImage(){ whichOne = Math.floor(Math.random()()*10 + .5); } if(whichOne==1){ attachMovie(image1,imageHolder); } if(whichOne==2){ attachMovie(image2,imageHolder); }
I`m not entirely sure as to what you are trying to do but try this stop(); fadeImages = setInterval(randomImage, 3000); function randomImage() { whichOne = Math.floor(Math.random()*2+1); if (whichOne == 1) { attachMovie(image1, imageHolder); } else if (whichOne == 2) { attachMovie(image2, imageHolder); } } //I`ve changed the way you get whichone to give a value of 1 or 2. Certified but not by Macromedia!
stwingy, Thanks for your reply, I appreciate it! I am trying to have Flash randomly load one image (out of five) and transition between the two with a keyframed fade. With your code, it still did not work, so I must be doing something wrong with my movie clips. I've been at this for too long and just getting frustrated. Thanks once again!!! Kind regards, Greg
the attachMovie code is not right anyway, are you trying to attach a mc or load a swf. Certified but not by Macromedia!
The code for attachmovie is wrong anyway, have a look at this,it might help. You may want to add some fadein,fadeout functions to it. Certified but not by Macromedia!
I am trying to load a movie clip that is created from a bitmap image. If you would be willing to take a look at the file, I can post it. If not, I certainly understand. I just appreciate you helping me out in any way. Thank you so much! Greg
Don't see what you're looking for? Try a search.
|