Reputation: 87
Hello there fellow stackoverflowers.
I have a hard time trying to figure out how to convert my AS2 code to AS3, i'm using movieclipduplicate:
duplicateMovieClip("Star", "Star", Count);
this.Star._alpha = 30 - Count;
Count = Count + 1;
Star is on stage...
Thanks in advance
Upvotes: 0
Views: 85
Reputation: 552
It will be easier if you will create new instance of MovieClip and not make copies of it (copies need more understanding in OOP concepts of AS3).
So you need to make "Star" symbol accessible by actionscript. For that you need to check its "Export for ActionScript" checkbox in Advanced properties which you could find in Library. In the Class field name your class. You could keep "Star" name.
Your code should look like this
var count=0;
var newStar = new Star();
newStar.alpha=0.3-(count/100); // 100% alpha in ac3 is 1.0;
count++;
There are many differences between ac2 and ac3. So for using it you should really be acquainted with its basic concepts. Here is a good place to start - http://www.adobe.com/devnet/flash/articles/first_as3_application.html
Upvotes: 2
Reputation: 1296
The best way is to learn AS3 first then rewrite your app in AS3.
Upvotes: 0