ForumsProgramming ForumAdding code to a movie clip

4 4163
ricvail
offline
ricvail
12 posts
Shepherd

hi...
I know it's just too stupid to be true, but I can't add the code to a MC
I create a new as3 file, i draw a circle in it, i convert it to a symbol (movieclip), i select it and i press f9. And i get an "actions" window with, on the white box where i should add the code, this message: "current selection cannot have actions applied to it"
where did i go wrong?
Ps... sorry for the bad english, i'm italian and it's 23 o'clok, i'm slipping away XD

  • 4 Replies
rjbman
offline
rjbman
215 posts
Nomad

To make an object move, first off you need to select the instance of the circle (the one on the stage). Then give it an instance name in the properties window. Then make a new layer (on the stage). Name it "actions". Click this layer, then go to actions. You'll be able to apply code using the instance name you gave it.

PrideRage
offline
PrideRage
148 posts
Nomad

To add code to a movie clip you need AS2, with AS3 you can't do that.

Normero
offline
Normero
23 posts
Nomad

You can't add code directly to a MovieClip in AS3.0

I suggest you read this:
http://www.adobe.com/devnet/actionscript/articles/as3_migration_cookbook/as3_migration_cookbook.pdf

It has been very useful to me

gone3d
offline
gone3d
17 posts
Nomad

If you create an instance of the MC in the code, either the document class or main action code and add it to the stage with addChild(MyMC), you can easily add code to control it there. It makes for better coding anyway, since it doesn't get hidden in among the timeline.

D

Showing 1-4 of 4