Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-04-2008, 04:21 PM   #1
s8000_1
Registered User
 
Join Date: Nov 2008
Location: Russia
Posts: 1
Default child UIComponent doesn't work, when added in draw method

Why does upper button "bt1" not working?
Code:
package  {
	import flash.display.Sprite;
	import fl.controls.Button;
	public class StageTest extends Sprite{
		
		public function StageTest() {
			var testC:TestComp = new TestComp();
			addChild(testC);
			
			var bt2:Button = new Button();
			bt2.label = "bt2";
			bt2.y = 30;
			addChild(bt2);	
		}
	}
}

import fl.controls.Button;
import fl.core.UIComponent;
class TestComp extends UIComponent {
	private var bt1:Button;
	
	public function TestComp() {
		bt1 = new Button();
		bt1.label = "bt1";
		//addChild(bt1); // if uncomment, button will work
	}
	
	override protected function draw():void {
		addChild(bt1);
		bt1.drawNow();
		super.draw();
	}	
}
s8000_1 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Database simulated with arrays on a cd-rom lecasn5 Components 61 09-07-2004 11:40 AM
An OOP question?? texbala ActionScript 1.0 (and below) 5 07-25-2003 10:13 PM
inheritance - Mortimer Jazz ActionScript 1.0 (and below) 10 07-24-2003 09:51 PM
Random fades rabblerouser ActionScript 1.0 (and below) 2 05-05-2003 03:20 PM
Targeted Movie Clips Don’t Work Once Loaded Into a Container Movie. jcolletti ActionScript 1.0 (and below) 2 10-03-2002 03:19 PM


All times are GMT. The time now is 04:24 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.