Flex :: Why Can't Get Sub-children Of Display Object
Oct 13, 2009I am having problems accessing sub-children of my displayObject. Here is my code:private [code]but it's not working.
View 1 RepliesI am having problems accessing sub-children of my displayObject. Here is my code:private [code]but it's not working.
View 1 RepliesHow do I remove all children from a display object container? I want to make sure that when I re-enter a particular frame that there are no imageLoaders loaded into my photoGallery.
View 2 RepliesI have a custom class extending MovieClip, and in my code I add a few children to this custom class.When I add my mouse over event listener, it works, but it fires every time the mouse rolls over any of the children too!I only want it to fire once when the display object as a whole is rolled over.
View 1 RepliesIs it possible to get dynamically created children of a display object instance in action script 3?
Example
trace(_view.getChildByName("name")) = returns name of display object (success)
trace(_view.getChildByName("name").getChildByName("name2") = returns error 1061
Would it be possible (Without being extremely inefficient) to loop through a display object and reset their children's ChildIndex based on their y value?
View 1 RepliesI'm trying to make a Flex Tree Component display the children of a sprite in a hierarchical way. Moreover, dragging the items on the FlexTree would resort and reparent the items. I have special Elements set as Folders. This would allow other elements to be added there as a children by dragging an element on the tree and dropping it there. I have a failed attempt which works, but breaks when I try to add folders. Basically, it fails at reparenting the items by dragging and resorting folders and that Does anyone know of a component or something which can do this, has anyone have created any of this or could anyone give me a clue?
View 1 RepliesIf I create a rectangle with 100px width and 100px height and then rotate it, the size of the element's "box" will have increased.With 45 rotation, the size becomes about 143x143 (from 100x100).Doing sometimes like cos(angleRad) * currentWidth seems to work for 45 rotation, but for other bigger angles it doesn't.At the moment I am doing this:
var currentRotation = object.rotation;
object.rotation = 0;
var normalizedWidth = object.width;
[code].....
I have a Canvas which has many components inside it and those again, have many components inside them.
getChildren() returns only the top level children. What is the best way to retrieve all the children (children of children of children and so on).
Well, I sorta know how to do this by iterating through the children, but the code is really messy. I'd prefer to use a nice recursive function. Has anyone written this before? Or is there a Util class to do this?
I have an ArrayCollection that is read to generate containers in an accordion programmatically:
<s:ArrayCollection id="_ac_ps">
<fx:Object label="Block and lot" data="_blocklot" searchType="districtblocklot"
info="" />
[code].......
I'm currently transforming some objects to make them appear far away using a PerspectiveTransform. This works well, but I have no way of knowing where on the screen the object is displayed. The x and y coordinates are the coordinates of the object if it were at z=0. How can I compute the display coordinates of my component?
View 1 RepliesI am trying to save a component as a JPG file and I can't seem to get the BitmapData.draw() to give me the pixels I'm expecting and instead I am seeing a plain white rectangle when I open the resulting JPG file. I am first creating an object which contains an image and a caption (the MultigraphCanvas below) and when I display the object as a pop up it looks perfect -- however when I try to draw it as a bitmap and then encode and save it as a JPG I don't end up with the same image I can display on the screen. [code]...
View 3 RepliesHow do I display children in succession? By succession I mean 1,2,3,4, etc. Perhapse incrementing with a loop or using a timer is what I'm after.
Add, remove, appear, or disappear children, could all work. I want a simple way to display 1 child every second until I reach 10.
METHODS TRYED
addChild, removeChild, AddChildAt, getChildAt, setChildIndex
visible !visible
for loop
I don't see how this works with multiple children.
How do I loop through all of my children, and display each? I would like to know the best way to do this. my children and containerfive children, one plays every sec, 1,2,3, etc.
[Code]...
what could I write to display how many/what children are on stage and it be displayed in the output window in a trace statement?
View 3 RepliesFor e.g.
function showIt():void {
something.visible = true;
}
function init():void {
[Code]...
In the above code, I want to measure the time taken to display st on screen.Is it enough to compute time2 - time1? Or should I put an event handler on render? Or some other way?
I have some MXML elements which i would like to remove and add to a parent element. Unfortunately I am constrained to removing the MXML object as this is handled by the custom component. So is there any way to reinstate a removed MXML element back into the display list?
View 1 RepliesI am basically trying to create a display object transformation manager which will allow me to scale/rotate objects. I am currently trying to figure out how to rotate an object so its corner follows the current x and y of the mouse. I always get confused on the math of things like this. I know how to listen for the events and everything, I just am unsure of how to calculate the amount of rotation to apply. I will probably be rotating via a Matrix so I can rotate the object around its center, rather than the upper-left corner of it. My question here is: how do I get values when I don't want them constrained, like scaleX and scaleY?
View 1 RepliesI have 2 possiblities. It looks like these are the same (or I'm wrong). Which is better and why?
var quest1:DisplayObject = FrameCanvas.baseCanvas.addChild(app.questionmark1); //
quest1.x = posX; //
quest1.y = posY; //
or
app.questionmark1.x = posX;
app.questionmark1.y = posY;
I am using swfLoader to load external flash movies in my flex/actionscript code. If the loaded swf was made for the newer flash player versions (I believe 9.0 or more) it loads as a flash.display.MovieClip object which has methods for play/pause and go to frame. However if the loaded swf was made for older flash player (I believe 6.0) then it loads as flash.display.av1movie which doesn't have methods for play/pause. Is there a way I can play / pause the av1movie from my flex code.
View 2 Repliesi have made a list control. i want to display the name of the objects in it in a text control box
the code i am using here is
public function add(event:MouseEvent):void
{
var str:String;
str = mylistcontrol.dataProvider.getItemAt(0).toString();
[Code]....
The problem with this code is i am using index value of 0. however i want to display the name of object on which i have clicked or which is highlighted.
I'm making a OSX-finder-type file browser in CS4.The Structure for the folder and files is being generated by a PHP in a XML, heres an example:(sorry the xml is not sorted, but the command i'm using in php doesn't sort it)
Code:
<root>
<dir name="images">
[code]....
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 RepliesI'm creating a swf, that has a parent class and a child class. The parent class has a button, that dispatches a custom event and I want the child class to list for this event, but when I dispatch the event the child class does not hear the event has been dispatched.[code]The register EventListeners() function is in the child class.I know events can bubble up the display list but how can then go down the list?
View 1 RepliesI am trying to build an MXML application with Flash Builder 4.5, and I am integrating an API that requires the root of a display object to be a MovieClip. Personally I think this is bad design but I have to go with it. The root object always seems to end up as the stage, because of course I have to add the object to the stage for it to be added to the display list. Is there some way that I can either change the stage type in an MXML application to a MovieClip or is there some way to force a MovieClip wrapper to become the root of a display object?
View 1 RepliesI am trying to do semi animated read-along online storybooks for kids and I would like to display the story/narration karaoke style so kids could see the story and be able to read along. I have been looking at karaoke software to do the text and voice synchronization and so far haven't had that much luck.
Synchronization is very important. I don't want to simply do an animated color mask over the test and have the text change color. Besides there are plenty of books I need to convert and the process needs to be simply automated and executed. Here is an example, [URL]
How to give a ms word like interface to a user so that he can enlarge and contract the display objects like Images, canvas, Hrules etc. at runtime in an web application?
View 1 RepliesIs there any way to test if a display object has been added to the display list?
View 9 Repliescan I resize a display object (container) without its contents (children) are resized?
For example, in the following code when I resize the green square, red is also resized. I wanted to resize only the green.
ActionScript Code:
import flash.display.Sprite;
var sprite:Sprite = new Sprite();
sprite.graphics.beginFill(0xff0000);
[Code].....
What's a simple way to detect if a display object is currently on the display list?
View 1 RepliesI have MovieClip, created with CS5. Is there a way to hide (set visible = false) all it's children (objects which lie on movie clip) within AS3 code?
View 1 Replies