Actionscript 3 :: Flex - Reference Flex Elements Added During Runtime?
Jan 17, 2010
I am having difficulty getting a reference to elements added after compile-time using the 'id' property. I have seen a few forum topics suggesting that this isn't possible, and that getting a reference to elements added this way is trickier, but never just exactly what that trick is. This code throws a fun little: Error: uncaught exception: Error calling method on NPObject! [plugin exception: "ReferenceError: Error #1069: Property canvas_tentpoles_0 not found on SGraph and there is no default value."].
[Code]...
View 2 Replies
Similar Posts:
Dec 2, 2010
[URL] This article seems to say that all Flex 4 elements are now being added to a project using addElement() instead of addChild(). So my only question is why the switch?
View 3 Replies
Sep 28, 2010
I wanna add dynamically (at runtime) new states to a container and, to this states, add different elements (like TextInput, Label etc.). This must be done from actionscript, I don't use any mxml file. I can add states and change properties or styles for different elements, but I didn't figured out how to add child elements for different states.
View 1 Replies
Aug 22, 2009
Is there any documentation link where I can find list of styles applicable to flex controls? In particular the AdvancedDataGridControl. Like border, border-left,top,bottom,indent, etc like list of all possible style elements.
#1: Link provided by Lior below is the complete list.
#2 : found this looks quite cool.
View 2 Replies
Aug 14, 2009
I have a drag-and-drop event form in a flex project. I need to run a validator right after the item is dragged into the dataGrid. In it, I fire off a function through dragDrop="verifyEventUsers()". In the validator, I compare the contents of the two arrayCollections, but it appears to be running the checks prior to completion of the drop. For instance, if I drag an element into the dataGrid and trace eventUsers.length inside the validator, I get zero. When I drag the second element, it traces as one even though two lines now appear.
How can I set up a validation script that runs after the drag-drop action has finished?
View 1 Replies
Apr 3, 2012
Ive been trying to get flex popups to open under some of my visual elements.
View 1 Replies
Dec 3, 2009
I'm creating a small size Flex movies which contains two line charts, at the moment the size of the release build swf is 343KB, which is too large for our needs.
I've tried changing the loading of the SWC file to Runtime Shared Libraries, but I found that this removed the text of the charts (the text for the x and y axis). Why would the text be removed when the Framework linkage is set as a Runtime shared library?
View 1 Replies
Feb 9, 2011
I'm trying to build a flex project, linking it to some RLSs. When setting up the project in Flex Builder, the corresponding "build configuration" (that I got by adding -dump-config to the compiler options) generates (among other things) a tag like this :
<runtime-shared-libraries>
<url>some-lib.swf</url>
<url>some-other-lib.swf</url>
[Code]....
View 2 Replies
Oct 17, 2010
Anyone know how to change a single instance of an item renderer for a Flex tree item at runtime? To reiterate, I'm not trying to change the entire tree's item renderer like this:tree.itemRenderer = new ClassFactory(ItemRenderer2);I'm trying to change the item renderer of a single tree item like this (the following code does not work):tree.selectedItem.itemRenderer = new ClassFactory(ItemRenderer2);To put it more simply, does anyone know how to reference an instance of an item renderer and set it to a new item renderer class? I've tried using the Tree's itemToItemRenderer() method with no success.
View 1 Replies
Jun 21, 2011
What is the URL that Flex 4 uses to download RSLs at runtime? I want to check if I have access to this URL and that it is not blocked by the proxy that I am behind and would like to be able to put the URL into a browser to do this.Obviously there are many URLs (one for each swz file), but does anyone know what the basic URL pattern is, or can anyone give me a sample URL?
View 2 Replies
Apr 3, 2012
I am coming from flash to flashbuilder I have a directory, AS3_classes_dir, on my computer that stores all of my classes, including my greensock and papervision packages. In every flash app that I make I include that directory in the Source Path, so that I can import whatever I may need. Compiling in flash (using ctrl/enter) takes very little time; only the classes that are specifically imported are compiled.So today I did that in flashbuilder, included AS3_classes_dir via Flex Build Path/Source Path ... but now the compile time are a couple of minutes, even though I am not even importing ANY of the classes from within.
View 2 Replies
Oct 20, 2011
Is it possible to create a display object in AS and take a screenshot of it as ByteArray or whatever without adding it to stage?
View 1 Replies
Jun 10, 2010
We are trying to automate our flex application. After adding automation libraries to our project we get the following exception:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.automation::AutomationManager$/addDelegates()
at mx.automation::AutomationManager$/addDelegates()
at mx.automation::AutomationManager$/addDelegates()
[code].....
We are using Flex 3.4 and maven2 to build the application.
View 2 Replies
Jan 4, 2007
Code:mcRotation = [000, 001, 002, 003, 004, 005, 006, 007];works just fine as is (well, it generates no errors). But as soon as I add one more element to it, 008, it generates an error:**Error** Symbol=alphabet bar graphics, layer=actions, frame=1:Line 8: ']' or ',' expectedI might as well forget about inputing the rest (up to 025). Just to verify, here it is up to 008 as I'm typing it:
Code:
mcRotation = [000, 001, 002, 003, 004, 005, 006, 007, 008];
You're probably wondering what's with the extra leading zeroes, well they are there for
[code]....
View 1 Replies
May 6, 2010
package uk.co.bigroom.utils
{
import flash.utils.Dictionary;
/**
* Class to create a weak reference to an object. A weak reference
[code]....
In this Class, how they denote one as Weak Reference and one as Strong reference.
View 1 Replies
Aug 8, 2009
Id like to be able to pass variables into a moviclip added at runtime as so:
var myText:String = ("My Text");
var myMC:MovieClip = new MyMC(myText);
// (MyMC from Library with 'Export for Actionscript enabled)
addChild(myMC);
I know I can just pass the bit in as
myMC.myTextField.text = ("My Text");
but I'd like to be able to pass a bunch of bits in at once, and create multiples...
View 2 Replies
May 22, 2010
function funFun():void{
someMC:MC = new MC;
someMC.property = value;
stage.addChild(someMC);
}
How do I access the properties someMC after it is added?
View 8 Replies
Mar 28, 2011
I created a child that will be added on runtime. How do I access a movieclip on the mainstage from within the child?
View 1 Replies
Sep 23, 2011
After adding an image to the stage, turning it into a Movie clip, and setting linkage in library to Export for Actionscript, I'm now using a timer to add a bunch of roses to the stage as a video plays.How can I get rid of all these clips once the video is over?Do I need to add all of them into an extra container and then just removeChild that container at the end? Or do I need to use something like getNumberOfChildren and then create a loop that removes them one by one?The clips (myRose) are fairly small and do not have any event listeners added to them. I just use TweenMax to move them from top to bottom of the screen.
public function roseTimer():void
{
MonsterDebugger.trace(this, "in roseTimer");[code]......
View 4 Replies
Mar 6, 2007
Is it possible in Flash 8 accessing from the linkage class, associated to a component, the graphics elements (for instance, a standard UI component, like a tree or a comboBox) that are on the movieclip this class refers to?
View 1 Replies
Jan 23, 2009
getChildByName("name") works great if my object has been added to the stage or some MC. But what can I do if I have an object created dynamically that I want to reference later in the code but haven't added to the stage? Here's an example:
for (var a = 0; a < 10; a++) {
var testObject = addChild(new BlankMC());
testObject.name = "myTest_" + a;
}
[Code]....
This returns my BlankMC instance, but ONLY because it was added to the stage. If I don't use "addChild", then I get "null" because my instance is not a child of the stage (or anything else as far as I know). Is getChildByName the ONLY function for referencing a dynamic element?
View 2 Replies
Jun 27, 2011
I have a MenuBar, which is using a XMLListCollection object as a dataProvider.I wish to add and remove elements from this collection at runtime.How to add / remove elements from XMLListCollection ?
View 2 Replies
Aug 29, 2011
My problem is basically as follows. There is an instance of a class extending EventDispatcher. Everything goes well when I add event listener to the object like this:
[Code]...
Now someFunction is not called even though the line containing dispatchEvent('eventName') is being executed just like before (and there is an external reference to myObject as well). The application I'm developing is quite complex so, unfortunately, I can't post the exact code.
View 2 Replies
Nov 22, 2011
I am currently having problems referencing a MovieClip child which I add to the Stage from the Document Class. Basically when the MovieClip child is added to the Stage from the Document Class, I want a certain MovieClip already on the Stage to reference it once it is on the Stage.
Also, if it is possible, I don't want the MovieClip referencing the child being added to the Stage to have parameters linking it with the Document Class, because I plan on nesting this MovieClip within another MovieClip later on in the future.
Here is the code for the MovieClip class which is referencing the child once it is added to the Stage:
package com.gameEngine.assetHolders
{
import com.gameEngine.documentClass.*;
import com.gameEngine.assetHolders.*;
[Code].....
View 2 Replies
Apr 19, 2010
I need to merge 2 arrayCollection and avoid duplicates. They contain objects with their own attributes. I would like to avoid duplicates.
View 2 Replies
Mar 15, 2011
I am trying to use ContextMenu() to display context menus in Flex 4.
Full Render code here [URL]
The problem is that the context menu does not change when I add items to it.
how to add a custom right click menu to a List box in flex (without using external JS, just using ContextMenu as Adobe intended.
View 2 Replies
May 27, 2009
I'm adding a line to a canvas using canvas.moveTo(0, 0); canvas.lineTo(100, 100);, but I then want the user to move the mouse to set the rotation of the line.Google suggests using the rotation property,but I don't have a reference to the line object.Can I get a reference to the line or should I rotate the whole canvas?
View 3 Replies
Jul 9, 2009
Is there a way to access the DOM-Elements of a mxml file in a way that you can in JS (e.g. using Prototype or jQuery)?
I need to know if a top-level element has a child (sub-sub-...-childs) with a certain id.
In JS (using prototype) it would be something like:
$('tabs').select('[id="something"]');
View 2 Replies
Jul 10, 2009
Is there any tool available for Flex applications that acts similar to Web Developer or Firebug toolbar to inspect UI elements? Basically in a complex hierarchy of UI controls allowing you to browse the elements and see properties such as x and y coordinates, width, height, id.I'm interested in tools that would allow you to do this at runtime, since most of the properties are dynamic.
View 3 Replies
Aug 13, 2009
In a Flex webapp, is there an easy way to go about applying a sort to the children of an XML element, based on the children's attributes? Example follows below:
XMLListCollection:
<a anotherProp="ABCDE">
<e prop="AB">1</element>
<e prop="BC">2</element>
</a><a anotherProp="FGEH">
<e prop="HF">3</element>
<e prop="AD">4</element>
<e prop="AC">5</element></a>
I would like to sort the <e> elements, within each <a> element separately, according to their "prop" attribute. My code for generating the array containing the <a> elements is along the lines of:
for each(var node:XML in initialInput:XMLListCollection){
if(node.localName()=="a"){
//I was hoping to be able to sort the <e> children of the node variable here
xmlListCollectionVar.addItem(node);
}}
At the end I would like the <a>'s to remain in their defined order, but their <e> children to be sorted based on the "prop" attribute. So far if I try:
node.children().sort=someSortVar
Where someSortVar has its fields set to:
SortFields("e.@prop",...)
I get an exception about a null value. Any way to convert the children list to XMLListCollection, sort it and integrate it back into the node variable?
View 3 Replies