![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am having a problem incorporating Flash into my web site. I created a Flash file where the first frame contains code that picks a random number 0-7. It then goes to a certain frame associated with each number, plays a small motion tween, then stops. I tested this out in the Publish Preview (both HTML and Flash) and it worked perfectly. So I published the file. I then opened the swf file, and it worked perfectly. I opened the html file and it worked perfectly, too. Thinking it was finished, I inserted it into a Dreamweaver file. I then tested the page in Publish Preview (Internet Explorer). Again it worked perfectly. I published the page and opened up the new htm file. Still worked fine. Then I FTP'ed both the swf file and the htm file to my server space. I opened up the page (which is now a part of my site) and the swf file loaded like it was supposed. HOWEVER...it seemed to ignore the random number picking. It just played straight through like a normal movie clip, playing the first listed motion tween, then stopping. It plays the same one over and over and NEVER switches. Of course it should be switching because of the randomness. I have copied the code into this message so maybe someone can find something wrong with it. Or maybe it's the Dreamweaver settings. I don't know. But it seemed to work in both Flash and Dreamweaver, but not when I put it on my server. Any ideas????? this.onLoad = function() { header = random(8); if (header == 0) { gotoAndPlay(79); } if (header == 1) { gotoAndPlay(56); } if (header == 2) { gotoAndPlay(33); } if (header == 3) { gotoAndPlay(10); } if (header == 4) { gotoAndPlay(102); } if (header == 5) { gotoAndPlay(125); } if (header == 6) { gotoAndPlay(148); } if (header == 7) { gotoAndPlay(171); } }; |
#3
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |