Accessing GUI-created elements in a class definition file in AS3 (Flash CS4)?

OK, it took a few days and some introspection, but it seems that the problem I've having stems from the fact that you cannot add children to a SimpleButton. I changed my class definition to extend a MovieClip, then created a function named "listen()" that I called when constructing the object that added listeners for the "over","down", and "out" mouse states, so as to imitate a simple button. I also had to put a "stop()" command in the constructor, so that each button wouldn't keep cyclying through all the states.

The final class definition looks like this: package com. Examples { import flash.display. MovieClip; import flash.events.

MouseEvent; public class DynamicButton extends MovieClip { public function DynamicButton(btnText:String="Click Me") { stop(); this. BtnText_btn. Text = btnText; listen(); }//constructor private function listen():void { this.

AddEventListener(MouseEvent. MOUSE_OVER,function(){ gotoAndStop(2); }//anon mouseover fcn ); this. AddEventListener(MouseEvent.

MOUSE_DOWN,function(){ gotoAndStop(3); }//anon mousedown fcn ); this. AddEventListener(MouseEvent. MOUSE_OUT,function(){ gotoAndStop(1); }//anon mouseout fcn ); } }//class definition }//package.

I then created a class definition file for this object so that I could dynamically change the label text (the text layer) when adding instances of this button to the stage. "Access of possibly undefined property btnLabel through a reference with static type com. The problem is that I can't seem to add the TextField to the SimpleButton, as it's not a display object.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions