homepage Welcome to WebmasterWorld Guest from 54.205.207.53
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
Flash Actionscript problem
yogi799

10+ Year Member



 
Msg#: 13 posted 8:54 pm on Jul 1, 2004 (gmt 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

 

benihana

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 13 posted 11:43 am on Jul 5, 2004 (gmt 0)

have you tired putting a :

stop();

on the fgirst line of the first frame?

yogi799

10+ Year Member



 
Msg#: 13 posted 6:55 pm on Jul 6, 2004 (gmt 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?

benihana

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 13 posted 6:58 pm on Jul 6, 2004 (gmt 0)

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

trying to narrow it down

yogi799

10+ Year Member



 
Msg#: 13 posted 7:02 pm on Jul 6, 2004 (gmt 0)

Nope. But then if I really use IE, will this make any difference for me?

benihana

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 13 posted 7:41 pm on Jul 6, 2004 (gmt 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

yogi799

10+ Year Member



 
Msg#: 13 posted 8:34 pm on Jul 6, 2004 (gmt 0)

Thanks for your help! Appreciate it.

jezra

10+ Year Member



 
Msg#: 13 posted 11:32 pm on Jul 6, 2004 (gmt 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.

winstun

10+ Year Member



 
Msg#: 13 posted 12:16 pm on Jul 7, 2004 (gmt 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.

yogi799

10+ Year Member



 
Msg#: 13 posted 12:48 pm on Jul 7, 2004 (gmt 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!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved