Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 08:13:03 PM

Pages: [1]   Go Down
  Print  
Author Topic: problem of action script 3 within Flash CS3 professional  (Read 897 times)
begeiste
Galactic Royalty
*****
Offline Offline

Posts: 371


WWW
« on: August 21, 2008, 05:49:30 PM »

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!
Logged
spiralee
Newbie
*
Offline Offline

Posts: 1


« Reply #1 on: August 22, 2008, 06:27:42 PM »

I'm just learning Actionscript 3 also so I happen to have a textbook right here next my computer.   It could be that there should be no underscore before rotation in the "rectangle._rotation += rotationAmt;" line.  So it should read "rectangle.rotation += rotationAmt;"  (pg 54 Actionscript 3.0 by Todd Perkins)

Logged
Pages: [1]   Go Up
  Print  
 
Jump to: