-
Cancerinform:
yes, I was extending the "other" class as MovieClip, and I extended the Main class similarly!
-
Flash/Flex Developer
If I understand this correctly.....
I would first place the library object on the stage....THEN I would assign the new class? HUH?
I have serveral buttons to place on the stage, and don't want to do them "manually", so I have this.
Code:
var MCname:Object = getDefinitionByName(interData.element[a].name);
var tempbutton = this[interData.element[a].name];
tempbutton = new MCname();
tempbutton.x = interData.element[a].x;
tempbutton.y = interData.element[a].y;
this.addChild(new NavButton(tempbutton));
I don't get any buttons on the screen using this. However, if I change the last line to
Code:
this.addChild(tempbutton);
I get the buttons, but the NavButton class isn't able to provide the control (of course). I need that control and I need to the ability to identify each button separately so I can perform different actions when they are clicked.
I may be making this harder than it should be, but I can't get my head to stop swimming....any help?
Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.
-
well, I don't know how all your project is structured, but if you're saying that the:
this.addChild(tempbutton);
...if that works from your other class and the tempbutton is displayed, then your issue is different from my issue and there would probably be something wrong with the way you are using the NavButton class. Have you tried this:
Code:
//....other code
var myBtn:NavButton = new NavButton();
this.addChild(myBtn);
//....more code
you may need to add an argument to your NavButton() constructor function to suit your needs, but that should work, at least according to the original issue.
-
Senior Member
Ok,
in the future:
1. don't continue such old thread and mix up topics.
2. give more information. The three lines of code don't tell very much.
- The right of the People to create Flash movies shall not be infringed. -
-
Originally Posted by cancerinform
Ok,
in the future:
1. don't continue such old thread and mix up topics.
2. give more information. The three lines of code don't tell very much.
I thought it was better to reuse a previous thread that pertained to the topic? Also, which code were you referring to?
-
Senior Member
I was making a general statement and addressing everybody who continued this thread.
Unless it is a sticky for resources as a general rule if you don't find a thread by search, which shows the solution you want, start a new one.
- The right of the People to create Flash movies shall not be infringed. -
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
|