FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Fast Clicking Freezes the Application!
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cambodia eXPlore Forum Index -> Flash Shockwave
Author Message
davidgue
first grade


Joined: 14 Mar 2007
Posts: 22

PostPosted: Fri May 18, 2007 1:32 pm    Post subject: Reply with quote

Thanks for the suggestions guys. I have a basic doubt here. Isn't gotoAndPlay a statement that you can use as a mouse event? As in, shouldnt it be used inside of on (release) or some event like that? Because I tried using the gotoAndPlay("Stage2") on the last frame of the scene and it did nothing Sad. So I assume it is because of that. Any suggestions? Thanks for being patient guys - if this doesnt work i would definitely post the fla.

Back to top
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 724

PostPosted: Fri May 18, 2007 2:56 pm    Post subject: Reply with quote



Good point, Here is what i come up with:

At the last frame, put this script:

this.onEnterFrame = function() {
gotoAndPlay("stage2");
stop();
trace("enter new stage");
}

Becareful when using this as it will basically point you to the stage2 all the times when the movie is played (this, refer to the stage itself, i guess )

Another one idea is to create a movie clip (invisible one) place it in the last frame and give it a name, aMovie, for instance. And then add this script to the last frame:

aMovie.onEnterFrame = function() {
gotoAndPlay("stage2");
stop();
trace("enter new stage");
}

___________________
You may wanna test out both method for your own understanding.

Back to top
davidgue
first grade


Joined: 14 Mar 2007
Posts: 22

PostPosted: Wed May 23, 2007 5:48 am    Post subject: Reply with quote

Guitarman,

Thanks for the suggestion. I was thinking along the same lines. I tried both the codes, unfortunately neither worked! Sad It seems straightforward but I guess am doing something wrong. I created a test file in which I am pretty much trying to do the same thing. This is the link:

http://www.speedyshare.com/403410536.html


Please take a look at it and let me know what you think. As you can see Scene 3 is not loading. I tried the invisible movie clip idea too..but I was doing something wrong with that and it didnt work. Thanks a lot!

Back to top
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 724

PostPosted: Sat May 26, 2007 12:16 am    Post subject: Reply with quote

david, I was busy with my assignment and now i'm ready to look into ur issue.
Please follow this instruction based on the file you sent to me:

1- On scene 2, add another keyframe next to the first keyframe. On that keyframe, add the following code:
Code:
gotoAndPlay("Scene 3", 1);


2- Open up the movie clip exist on scene 2, then on the last frame of the movie clip i.e. frame 65, remove the old codes and add this:

this.onEnterFrame = function() {
Code:
_parent.gotoAndPlay(2);
stop();
trace("enter new stage");
delete this.onEnterFrame;
}


It should work very well now.
Discussion
The idea behind this is that the gotoAndPlay is a little stupid when using with MovieClip, so we have to trick it to use the main timeline instead of the movieclip itself.

Source: http://iat.ubalt.edu/courses/old/pbds668.185_Sp02/gotoProblem.shtml

Back to top
davidgue
first grade


Joined: 14 Mar 2007
Posts: 22

PostPosted: Sun May 27, 2007 11:37 pm    Post subject: Reply with quote

Guitarman,

Thanks so much for taking time off to help me out. This code worked great!!!! I can't tell you how helpful this has been.. And the link is really useful too - i haven't read it fully, but I see the problem with gotoAndPlay(). I had a doubt though- what is the significance of using the this.onEnterFrame here. I typed in just these lines on the last frame of the movie clip (as opposed to entering it as a function):

_parent.gotoAndPlay(2);
stop();
trace("enter new stage");

And it seems to work fine. Your thoughts?

Thanks again mate!

Back to top
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 724

PostPosted: Mon May 28, 2007 2:45 pm    Post subject: Reply with quote

good to hear that david.
well, the onEnterFrame is just based on my taste, nothing important Smile

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cambodia eXPlore Forum Index -> Flash Shockwave All times are GMT + 8 Hours
Goto page Previous  1, 2
Page 2 of 2



by phpBB