|
-
problem of action script 3 within Flash CS3 professional
Hi,
I am a new player of ActionScript 3 in Flash CS3 professional version. I don't know why the ActionScript I wrote, it didn't work while I published it. Would you please tell me what was it wrong? Basically I just made a mcRectangle as a movie clip in the library and drop three rectangles with different sizes and named them:rectangle1_mc.rectangle2_mc,rectangle3_mc for their instance names.
Here is the ActionScript3 code:
Code:
function moveRectangle(rectangle:MovieClip, movement:Number, rotationAmt:Number):void
{
rectangle._y -= movement;
rectangle._rotation += rotationAmt;
}
moveRectangle(rectangle1_mc, 150, 45);
moveRectangle(rectangle2_mc, 250, 90);
moveRectangle(rectangle3_mc. 50, 180);
Any helps would be much appreciate it!
-
_y and _rotation (and everything else) lost the underscore in AS3. Change to just plain y, and rotation.
-
 Originally Posted by 5TonsOfFlax
_y and _rotation (and everything else) lost the underscore in AS3. Change to just plain y, and rotation.
Removed the underscores, didn't work as well? Not sure what is going on AS3?
-
Are you getting error messages? What do you mean by "didn't work"? Exactly what is happening?
-
do you need an event to listen for in order to trigger the function?
-
His code explicitly calls the function. Given the way it's written it would appear to be frame script, and should execute upon entering that frame.
Without knowing the errors he's receiving I don't think we can get further.
-
OOP is one letter from OOPS
I am going to guess that all you see it the rectangle at the last set of coordinates. Since the function calls happen so quickly, you will not see any transitional movement between the function calls.
I have an animation library that has a moveToPoint function in it that you could use at http://code.google.com/p/ooas/source.../vfd/animation
Since the animations are built on tween classes, you can add event listeners to the end of the tweens and get the sequenced animation I assume you are going for.
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
|