I was messing around with AS3 and I made it with some help to get my Character in my Game and let it walk. I have made a new AS File and called it Friend and made a new MC with a linkage: mc_Friend, and i have made this script, no errors too.. strange.. package { import flash.display.*; import flash.events.*; public class Friend extends MovieClip { var parentMC:MovieClip; var friendMC:MovieClip; public function Friend(mcParent:MovieClip) { parentMC = mcParent; friendMC = null; AddFriend(350, 250); } public function AddFriend(xPos:Number, yPos:Number) { friendMC = new mc_Friend(); parentMC.addChild(friendMC); friendMC.x = xPos; friendMC.y = yPos; } } }
When I test my Movie my friend wont show up, and now my question is WHY? . Can someone explain me??
so is this your document class? and if its not the movieclip must be added threw the document class. MovieClip extension is really the swf, its like the parent Movieclip of all other movieclips
public class Main extends MovieClip { var myCharacter:Character; var myFriend:Friend; public function Main() { myCharacter = new Character(this); myFriend = new Friend(this); } } }