|
-
buttons not able to control a movieclip's timeline
i have 2 buttons (prev and next) that should control the timeline of a moviclip called "container"
but it just doesn't work. at first it moves to the second frame on this movieclip then the container shows always the same content ( it has different content for each frame), the content of the second frame.
though , the output panel shows:
prev. cf: 2
next. cf: 1
Code:
function btnContainerClick(e:MouseEvent):void
{
if (e.target.name == "btn_prev")
trace ("prev. cf: " + container.currentFrame);
// container.gotoAndStop(container.currentFrame - 1);
container.prevFrame();
// container.gotoAndStop(2);
if (e.target.name == "btn_next")
trace ("next. cf: " + container.currentFrame);
// container.gotoAndStop(container.currentFrame + 1);
container.nextFrame();
// container.gotoAndStop(5);
}
i get absolutely no clue of what's going on and i'm getting insane.
i really appreciate any help. thanks a lot.
-
Senior Member
If this doesn't help, please attach a source file, and we'll go from there, but until then, try the following:
Code:
function btnContainerClick(e:MouseEvent):void {
if (e.target.name=="btn_prev") {
trace("prev. cf: " + container.currentFrame);
container.prevFrame();
}
if (e.target.name=="btn_next") {
trace("next. cf: " + container.currentFrame);
container.nextFrame();
}
}
It looks to me like your conditionals aren't properly formatted. Remember to keep all actions assigned to the particular condition within the condition to which they apply. Then the container.gotoAndStop(5);
I wasn't sure when that was supposed to happen.
Does this help?
-
lemon juice hurts your eyes
EDIT: this post can be removed, misread your code
Last edited by florianvanthuyn; 08-13-2009 at 05:13 PM.
Reason: stupidhead me
Florian Vanthuyne
WAR AGAINST SOLVED THREADS
mark yours as Resolved under Thread Tools!
Tags for this Thread
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
|