syntax error? Where?
hey hey
where for the lifeame is the syntax error in this script? I cant get it
import mx.transitions.Tween;
function doTheAction(clip:MovieClip, action:String):Void
{
switch (action){
case "toCenter":
clip._x = Tween(clip,"_x",Regular.easeInOut,clip._x,Stage.wi dth/2,30,false);
clip._x = Tween(clip,"_y",Regular.easeInOut,clip._y,Stage.he ight/2,30,false);
break;
case "wobble":
clip._parent.gotoAndStop("wibblewobble");
break;
case "whatThe****":
_level0.dummyClip.gotoAndPlay("somewhere");
break;
}
};
if i wasnt so bald id be pulling my hair out
Try using new Tween:
code:
clip._x = new Tween(clip,"_x",Regular.easeInOut,clip._x,Stage.wi dth/2,30,false);
clip._x =new Tween(clip,"_y",Regular.easeInOut,clip._y,Stage.he ight/2,30,false);
K.
Senior Member
you cannot assign a class to a mc's _x property,
should be something like this;
Code:
import mx.transitions.Tween;
function doTheAction(clip:MovieClip, action:String):Void {
switch (action) {
case "toCenter" :
clipXTween = new Tween(clip, "_x", Regular.easeInOut, clip._x, Stage.width/2, 30, false);
clipyTween = new Tween(clip, "_y", Regular.easeInOut, clip._y, Stage.height/2, 30, false);
break;
case "wobble" :
clip._parent.gotoAndStop("wibblewobble");
break;
case "whatThe****" :
_level0.dummyClip.gotoAndPlay("somewhere");
break;
}
}
Flash Gordon
Tween is the Class name, thus has no return parameter either...
As such change:
Code:
clip._x = Tween(clip,"_x",Regular.easeInOut,clip._x,Stage.width/2,30,false);
clip._x = Tween(clip,"_y",Regular.easeInOut,clip._y,Stage.height/2,30,false);
to
Code:
new Tween(clip,"_x",Regular.easeInOut,clip._x,Stage.width/2,30,false);
new Tween(clip,"_y",Regular.easeInOut,clip._y,Stage.height/2,30,false);
My letters on the F1 key have faded, how are yours today?
LOL...I didn't even notice that that code was trying to attach the Tween to the clips X property...
Tweens do have a return type though, so you can assign it to a variable:
var myTweenX=new Tween(clip,"_x",Regular.easeInOut,clip._x,Stage.wi dth/2,30,false);
var myTweenY=new Tween(clip,"_y",Regular.easeInOut,clip._y,Stage.he ight/2,30,false);
K.
Flash Gordon
Err, of course returns every constructor the instanciated Class, dunno why i wrote the above BS
My letters on the F1 key have faded, how are yours today?
yes!
Hey wow it affected the clip!
I think I get some of whats going on here...
Unfortunatly it doesnt break up the rotation, the clicked clip still rotates along in its own world off stage...how would the rotation be stopped so the selected clip moves to the center and sits there?
I thought the break; line did that? Is it necessary to stop all the other functions going on in there for that?
Attached Files
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