-
prgrmr 4 hours user 4 years
how to create a symbol in code
how do I create a symbol in code from the library and name it in code
Current File:
http://www.filedropper.com/untitled1_13
Last edited by ym54; 01-29-2010 at 05:41 PM.
-
I don't think you can create new "library symbols" dynamically using ActionScript.
What you can do is create copies of "symbols" that are already in the library.
-
prgrmr 4 hours user 4 years
-
In AS3 if you've created a symbol and given it a class name "TestSymbol".
You can create a copy of the symbol like so...
Code:
var test:TestSymbol = new TestSymbol();
addChild(test);
-
In AS2, you would use the attachMovie() method.
-
prgrmr 4 hours user 4 years
ok how can you make everything from the same class behave the same way
-
prgrmr 4 hours user 4 years
ok I put the code in
but the bullet is not appearing
how do I define its appearing spot
also how do I make its angle, and direction the same as "shooter"
and make it go that way
current code:
PHP Code:
setInterval(shoot,10);
function shoot(){
shooter.direction=Math.atan2((shooter.y-mouseY),(shooter.x-mouseX));
shooter.rotation=(shooter.direction*180/Math.PI-90);
shooter.speed=20
var test:bullet = new bullet();
addChild(test);
}
-
Are you using AS2 or AS3?
-
prgrmr 4 hours user 4 years
-
have you setup a linkage with the export to Actionscript checked, and the correct class name?
-
prgrmr 4 hours user 4 years
-
prgrmr 4 hours user 4 years
-
prgrmr 4 hours user 4 years
-
prgrmr 4 hours user 4 years
Tags for this Thread
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
|