Welcome to WebmasterWorld Guest from 54.196.110.18

Forum Moderators: open

Message Too Old, No Replies

Flash Actionscript problem

     
8:54 pm on Jul 1, 2004 (gmt 0)

New User

10+ Year Member

joined:July 1, 2004
posts:5
votes: 0


I have a simple flash animation which uses the following script:

gotoAndPlay (random ( 3 )*40+1);

Which randomly generates the beginning frame of the movie (1, 41, 81, or 121).

WHen I publish it, it works great as a swf. file but does not work on a web page itself in IE. It keeps on playing the movie from the beginning.

Any clues?

Thanks

11:43 am on July 5, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 13, 2003
posts:1240
votes: 0


have you tired putting a :

stop();

on the fgirst line of the first frame?

6:55 pm on July 6, 2004 (gmt 0)

New User

10+ Year Member

joined:July 1, 2004
posts:5
votes: 0


I'm afraid I have - what bothers me is that the SWF file itself works great just like it should and the same file embedded in the webpage is not playing right. Anyone had this happen before?
6:58 pm on July 6, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 13, 2003
posts:1240
votes: 0


when you say " in IE", have you tried other browsers?

trying to narrow it down

7:02 pm on July 6, 2004 (gmt 0)

New User

10+ Year Member

joined:July 1, 2004
posts:5
votes: 0


Nope. But then if I really use IE, will this make any difference for me?
7:41 pm on July 6, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 13, 2003
posts:1240
votes: 0


probably not really, just eliminating things :)

really dont know whats causing it, but would maybe try putting the script in the first frame (as you have)
but the rest of movie at 2, 42, 82 etc, and adjust the random accordingly. worth a shot.

good luck
ben

8:34 pm on July 6, 2004 (gmt 0)

New User

10+ Year Member

joined:July 1, 2004
posts:5
votes: 0


Thanks for your help! Appreciate it.
11:32 pm on July 6, 2004 (gmt 0)

Full Member

10+ Year Member

joined:Feb 4, 2004
posts:215
votes: 0


I've had a similar issue in a large swf that was only 6 frames in length. If the function gotoAndPlay(6) was called before frame 6 was loaded into memory, the swf would goto and play frame 2 because it was the highest numbered frame that was loaded at the time. The problem was fixed by adding a preloader that wouldn't call the "gotoAndPlay()" function until all of the frames were loaded.
12:16 pm on July 7, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 3, 2003
posts:53
votes: 0


Good call, Jezra.

The pre-loader may be worth a shot.
Perhaps you could also try a

this.onLoad = function(){
// insert randomizer function call here
}

in the first frame of the _root timeline.

No guarantees, but couldn't hurt.

Good luck.

12:48 pm on July 7, 2004 (gmt 0)

New User

10+ Year Member

joined:July 1, 2004
posts:5
votes: 0


Unfortunately, I've tried something similar, too. Making sure the last frame was loaded before the function was called. But I will look into it again - maybe my code was faulty. I, too, have a feeling the problem lies in here. THANKS A TON, GUYS!
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members