-
nextFrame();
OK, Fk says my last login was 3/23/2006! So I'm rather rusty!
All I wanted for now is to drag an image and update the view on release. So, I have two frames:
1) Layer 1 : Frame 1
stop();
2) France_draggable (a movie clip)
on (press) {
startDrag(this, false);
}
on(release) {
stopDrag();
start.gotoAndPlay(2);
nextFrame();
nextFrame();
}
and...
3) Layer 1 : Frame 2
stop();
When I play, it starts and stops dragging nicely. But it will not advance the frame. If I try something else like getUrl, that works fine too. gotoandPlay does nothing as well, though.
What am I missing?
This is Flash MX2004, as2.
-
looks like a scope issue. What timeline are you trying to advance? If it is the main one you need to use _root.nextFrame(); Also where is this movieclip start? Is it within the France_draggable movieclip? And why are you calling nextFrame twice?
while (2+2 == 4) {
drink ("bourbon");
}
gotoAndStop("bed");
-
Great, thanks. Figured it was scope, but none of the tutes was clear enough.
Two questions:
-Should france_draggable perhaps have been a button?
- What else should I know about scope--other than _root?
-
Originally Posted by ej0c
Great, thanks. Figured it was scope, but none of the tutes was clear enough.
Two questions:
-Should france_draggable perhaps have been a button?
- What else should I know about scope--other than _root?
If it's a button or a movieClip depends on what functionality do you want to implement.
Every movieclip has it's own timeline. In AS2 the main timeline is the _root. You can access each timeline (movieclip) of nested movieclips with the dot syntax. For example if you have on the main timeline a MovieClip instance called "circle" and within it another movieclip called "square". To make square go to the secondframe you need to use _root.circle.square.gotoAndStop(2); Or if you are attaching the code to the circle movieclip then you can use square.gotoAndStop(2)
Generally it's a good practise to have all your code on the first frame of main timeline.
Here is a good article on scope:
http://www.adobe.com/devnet/flash/ar...ctices_04.html
while (2+2 == 4) {
drink ("bourbon");
}
gotoAndStop("bed");
-
Thanks!! I read a bunch of "basic" tutorials that just glossed over that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|