Calling addChild with an empty string as the value (or even with whitespace) seems to cause a redundant SimpleXml node to be added inside the node instead of adding just the node with no value. Does anyone know of a workaround for this?
...
Hi, i have a problem using AS3 - Flash CS3 gives me this Error message: Error #1065: Variable addChild is not defined.
Any ideas what's wrong?
This is my code:
package coa.application{
import flash.display.SimpleButton;
import flash.text.TextField;
import flash.text.TextFieldType;
public class Tab extends SimpleButton...
I am trying to load a swf written in AS2 into an AS3 swf - using Loader class and listening for Event.COMPLETE. in my onCompleteHandler function i want to add this to the stage so Im trying -
addChild(evt.currentTarget.content)
... but I get the following error message:
Error #2180: It is illegal to move AVM1 content (AS1 or AS2) to...
Have little bit of problem for my flash apps
I have a loader which load the image from the server. I also have a large movieclip that hold a list of small movieclips that are used to preview an image using the loader class.
It can display the image if I used the loader to add it directly on the large movieclip but it doesn't display t...
So I successfully added a movie clip from the library using addChild(), but now I want to access some movieclips that were in that dynamically added movieclip.
I've used standard dot notation and also getChildByName passing it the instance names.
What am I missing here?
---- EDITED ----
I tried the suggestion of looping through and c...
I'm trying to do a simple test to figure out another bug, but I'm getting Access of undefined property tsLogo for addChild(tsLogo);
I don't get it because this is simple timeline code on the first frame:
var tsFont = new TextFormat();
tsFont.font = FranklinGothic;
tsFont.size = 8;
tsFont.color = 0xFFFFFF;
tsFont.align =...
Happy Pre-Halloween everyone :)
My issue today is a DisplayObject error I'm getting when remove a child object. I have code that will launch(addChild) a video container and video controls as well as add a close button. Now the close button works fine and everything, removing the video and controls and I'm able to choose another video ag...
I have a Flex application which references a separate MXML file as a template for a custom component. I create instances of the component dynamically several times in my program, but I need to get a handle that will allow me to modify that instance of the component as desired.
I pass specific information to this component on instantiat...
Hey there, I was wondering if this is possible to do
I am able to load the image in and have it displayed easily enough by using addChild(myLoader); where myLoader is in the classWide private scope.
The problem is, whenever I call my function inside that class which adds the loader to the stage, it clears the old one and puts this new o...
In my application, I have a chart that I want to display in a TitleWindow when clicked on.
var win:TitleWindow = PopUpManager.createPopUp(this, TitleWindow, false) as TitleWindow;
win.addChild(myChart);
PopUpManager.bringToFront(win);
It does indeed place the chart in the titlewindow that shows up, but it remov...
Hi.
I want to be able to load an swf into a flex 4 application in order to use it's classes.
var ldr:Loader=new Loader();
ldr.load(new URLRequest("file://path/to/fileswf"));
ldr.contentLoaderInfo.
addEventListener(Event.INIT, loaded);
function loaded(evt:Event):void { addChild(ldr); }
i receive the error:
Error: addChild() is not a...
I am having troubles adding a radiobutton to a VBox in actionscript.
var radioButton:RadioButton = new RadioButton();
radioButton.groupName = "source";
radioButton.label = "label";
radioButton.selected = false;
radioButton.addEventListener(Event.CHANGE, sourceChangeHandler);
vBox.addChild(radioButton);
I firs...
There is an example on Adobe livedocs for using states:
<!-- Define one view state, in addition to the base state.-->
<mx:states>
<mx:State name="Register">
<mx:AddChild relativeTo="{loginForm}" position="lastChild">
<mx:target>
<mx:FormItem id="confirm" label="Confirm:">
...
Hey all. I'm working on an application that was originally intended for HTML, but I've recently concluded that the best thing to do for my purposes is to do it in Flash instead.
One of the big things I need is to be able to bring in movieclips from external files and add them to my main movie at runtime (dynamic number of elements, skin...
I have a panel with a button in it. Clicking on the button will direct the panel to state "State2" adding another two buttons into the panel. During the state change, I want the panel to resize first and then show the newly added two buttons, so I applied transitions onto the state change.
My question is:
If I put the two buttons withi...
Hi All - I am still a bit of a beginner at AS3, so bear with me, please.
I have created a loop to instantiate tiles on a board. In the following example, "Gametiles" is an array containing objects of class "Tile" which is a class that extends MovieClip. "Game" is a MC that I added to the stage in the flash developing environment.
for...
i am new to Actionscript3, i need to know why i keep getting Parameter child must be non-null. And my code won't display 5 enemyBlock objects onto the stage but only just one.
any tips and help will be much appreciated. thanks in advance.
returns:
TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayO...
I think this is a pretty simply problem but I do not seem to be able to pull it off. Basically I have a parent class A, and a child class B. Class A instantiates class B with addChild. There is a shared object which is being updated from a java server (red5) that has an event listener attached to it in class A. I have a function in c...
Hello.
I am a newbie, and I have seached and tried for weeks on this, and I cannot get the grip on this. The simple code below gives the "The supplied DisplayObject must be a child of the caller" error.
var square = new squareObj;
addChild(square);
addEventListener(Event.ENTER_FRAME, removeSquare);
function removeSquare(evt:Event):void...
Hi,
I'm new to flash in general and have been writing a program with two classes that extend MovieClip (Stems and Star).
I need to create a new Stems object as a child of the scene when the user stops dragging a Star object, but do not know how to reference the scene from within the Star class's code.
I've tried passing the scene into...