Posted by: Yogesh Puri on: October 21, 2008
Following is a code to remove a child from a parent by passing it’s instance name as a string and parent as a display object
import fl.controls.Button;
//———– Draw a graphics on the stage ———-
var t:Sprite = new Sprite();
t.name = “testSprite”;
t.graphics.lineStyle(1,0×0000ff);
t.graphics.beginFill(0xff0000);
t.graphics.drawCircle(0,0,50);
t.graphics.endFill();
addChild(t);
t.x =100;
t.y = 100;
//———– Remove Child Function ————–
function removeChildWithRef(spriteName:String, parentObj:*){
var t:DisplayObject = parentObj.getChildByName(spriteName);
parentObj.removeChild(t);
}
//————- Add a Button [...]
Posted by: Yogesh Puri on: October 10, 2008
While reading a book i come to a very interesting topic which i would like to share here
———————–
By default, The bitmap instances that reference a given BitmapData object are notified every time setPixel32( ) or setPixel( ) is called on that object. When setPixel32( ) or setPixel( ) are used in rapid succession within the [...]
Posted by: Yogesh Puri on: October 9, 2008
The following code is solution to a problem where you need to make the accordion component’s MouseOver event to behave like a click event. The code will work only in the case if you have not given the names to the AccordionHeader explicitly. Check the solution out here
<?xml version=”1.0″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”>
<mx:Script>
<![CDATA[
public function onMouseOver(evt:MouseEvent):void{
var strName:String = [...]
Recent Comments