Flash :: Loop Through Children In MXML View?
Mar 5, 2011
I have mxml component and want to go through all its children, that I've created in it and not to go deeper. For example I have this view:
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[Code].....
View 1 Replies
Similar Posts:
Mar 30, 2010
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]...
View 1 Replies
Dec 3, 2011
I have the following problem of how to display another mxml file as main view of application For example, lets say I have main.mxml displaying as main window. When I click button I want to display another mxml file lets say newMain.mxml and close main.mxml
View 1 Replies
Dec 9, 2009
I am trying to develop a custom component to act as a divider.
[Code]....
I would like to use this component to assign objects like this:
[Code]...
Unfortunately, this does not work. I get a compiler error saying: In initializer for 'left': multiple initializer values for target type mx.containers.Canvas.
View 1 Replies
Feb 11, 2010
Is there an easy way to make a parent container (eg Group) resize when it's children resize?
Below is a little example app. When I put the 200x200 'food' in the 'stomach' the stomach & it's containing 100x100 'body' should resize to contain the food.
[URL]
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[Code]....
View 2 Replies
Feb 24, 2011
I have a custom component extending Group and containing a viewstack child. The component is coded in actionscript.
When instantiating the component in mxml like so:
<components:CustomGroup width="100%" height="100%">
<mx:HBox backgroundColor="0xDDFF11" width="100%" height="100%" />
<mx:HBox backgroundColor="0x22DD63" width="100%" height="100%"/>
</components:CustomGroup>
...I would like to override whatever function that adds the children to the parent Group and add them to the child viewstack instead but I can't seem to find where the adding occurs. Breakpoints in addChild and addElement shows that they are not called during the add.
View 2 Replies
Sep 24, 2009
Does MXML get compiled down to as3 and then converted to flash bytecode? Also, is there a significant performance penalty to compiling mxml vs compiling as3?
View 3 Replies
Jan 2, 2009
I am trying to use for loop to load small grey box to display in the image below.
But i couldn't figure out how to put in the if else condition when the col hits 7 and bring it to the next row.
Below is my if else code:
container1 = new Array();
container1 = this.firstChild.childNodes; //drawing info from xml file
spacing = 13;
[Code]....
View 1 Replies
Nov 13, 2009
I am using a GroupingCollection to bind my advanceddatagrid. I have used groupingcollection to group the data by date.
Now I need to select the data in the datagrid through the code. I need to loop through the adg's dataprovider and select the item that matches the criteria for the selection.
View 2 Replies
Aug 25, 2010
I have a number of MC's that I've assigned listeners to through a loop that references an xml table.
//create listeners for all biketrails mc's and designate functionsfunction createListenersbk():void{for(var i:uint=0;i<bktrlXml.row.length();i++){var mc:MovieClip =
[Code].....
I thought I'd be able to replicate the above code and somehow refernce the "idlink" children through the e.curentTarget.
View 1 Replies
Nov 8, 2009
I have a movie clip (mc_moviegroup) which is made of a group of many dynamic text fields. I want to loop through the dynamic text field children of mc_moviegroup and pull out their text values in a string. Does a movie clip have a property which gives the number of it's children movieclips?
View 2 Replies
Jan 14, 2010
how could I make a simple loop which loops through the childrens of specific movie clip and add each of them instance name lets say "iname", since I have movie clip in which childrens are not added by code.
And if I'm sure I could acces those childrens then by code like iname.x = 100?
View 6 Replies
Sep 13, 2010
so on my main stage I have clips that are placed with AS.
container.1
container.2
container.3
and so on....
I am trying to add children to these and tween them with a loop in this function.
[Code]...
View 4 Replies
Dec 20, 2010
I'm making a plugin that used for posting a http url to the server every 3mins when we open a stream. and the server system will return
- 200 OK
- 400 FAIL.
In case of OK do nothing In case of FAIL stop the stream and open an pop-up window. User can press OK and a new page will be open.
View 0 Replies
Mar 3, 2010
I'm trying to make a dynamic image gallery from and xml. From my tutorials, right now i've got it so it will constantly add the next thumbnail below the other, which is fine, but I'm trying to figure out how to make it that once it reaches a certain y coordinate, it will move the x coordinate over and stack them again. So that rather one long list of thumbs, it will be a side by side stack. For some reason, I can't get it in my head how something like this would work. My goal is to have a side by side stack that I will end up putting in a movie clip that will be masked to show only 2 stacks at a time. Then when clicking a button will slide it over. I was planning to use the "movieclip.length" to calculate how far over to move it, but i haven't gotten that far yet. This is what I got:
[Code]....
View 1 Replies
Nov 15, 2011
So I'm working on a Flash version of the old "Robots!" game. In case you're not familiar: the game lays out a number of robots on a grid (number varies by level), and drops the player in the middle. As the player moves around the grid, the robots all move towards the player one grid space per player move. The object is to destroy all the robots by making them run into each other (or the rubble left from previous collisions) without letting a robot run into you.
Anyway, my robot hordes are being created on the stage through a "for" loop, and each icon is a child of variable "evilBot" which references a library item with the class name "enemy."
ActionScript Code:
function placeBots():void{
for (var c = 0; c < numBots; c++){
evilBot = new enemy;
[Code]....
I've run a trace on "evilBot.name" and verified that the children are being given instance names of "evilBot0, evilBot1 ..." and so on. But no matter what I try, I can't issue instructions (regarding movement, orientation, etc) to individual children.
Using a for loop and "this["evilBot" + x]" returns a "term is undefined" error.
If I store the instance names in an array (named "botName") and use "evilBot.name[botName[x]]", I get the error "Property evilBot0 not found on String and there is no default value."
View 9 Replies
Nov 18, 2009
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]....
View 2 Replies
Aug 17, 2011
Flex's new States re-parents visual items that are marked with includeIn/excludeFrom. If I have a Group (MainGroup) with 5 children/elements that are state controlled, is there still a way to get a reference to MainGroup's children? mainGroup.numChildren and mainGroup.numElements don't work since the children are re-parented. At best, they show 1.
<s:states>
<s:State name="view1State" />
<s:State name="view2State" />
<s:State name="view3State" />
[code]....
View 4 Replies
Sep 5, 2009
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 Replies
Jan 27, 2010
I'm currently working on a custom component which extends Canvas (let's call it SuperCanvas) ; it's basically a container that let you zoom & pan its contents. It would be too long to explain why, but I can't use scrollRect, so I was forced to declare a Canvas object (called innerCanvas)... inside my SuperCanvas (I know, not very nice =/) I would like to know if there's a proper way to "redirect" the creation of my component's children in this canvas.
[Code]...
View 1 Replies
Jun 4, 2011
I am working on a custom Flex 4 component which is an aggregation of two existing flex components. I would like to be able to specify my own custom properties for the component as well as access the existing public subcomponent properties via MXML. For instance I might want to adjust the font color or style for the label and text input. toy component which aggregates both a label and a text input:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[code]....
View 1 Replies
May 28, 2011
I am trying to override a Button class, i have a few properties which i wish directly initialise with the mxml description of the component, like :[code]which function is triggered ( in order to override it ) when all properties with mxml description is fully initialised with their values ?
View 1 Replies
Feb 3, 2011
What I'd like to do: create an MXML component with some children, then extend it via MXML to create a new component with more children, without losing the original set.In other words
create a component bc.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
[code].....
View 1 Replies
Jun 22, 2011
I'm trying to do this using only mxml, no <script> tags, although I don't necessarily need a solution that's only mxml. It was more of an educational exercise to see if I could do it all in mxml. I have a custom component that has a slider and textinput and their value/text properties are bound together. I'm surfacing a few properties of the slider in my component so that it can sort of be treated like a slider.
[Code]...
View 1 Replies
Sep 27, 2011
i have defined some functions in a component mxml file let us say addbutton() now i want to call this function in main mxml file.
View 2 Replies
Aug 3, 2010
I'm about to have to write a web page/app that will serve the agenda for circa 100 people on a page. One line per person, one column per day with 3 clickable zones in each cell. In HTML, the page is way complex for the browser to load quick and there is no possibility to click on a border between 2 cells to for example split an event that spreads among several cells. So I search an not too overkilling technology to render this kind of view. I begun with a PHP generated HTML page but the number of elements in the page make the mouse move jerky.
Moving to JAVA would give me better performances regarding the reuse of the generator of the view but it will still be an HTML page. So, here is my question: do you think that going forward with JAVA and its graphical capability is the simple solution or is Flash a better option for this part of a Web App? I'm afraid of the code I'll have to write in JAVA to handle the GUI presentation as well as the events generated by the 1000's cells plus borders of the page. In Flash, the graphical part seems simpler even if the actions handling is still huge.
View 2 Replies
Aug 15, 2011
I'm currently using RobotLegs with the Presentation Model pattern to develop a Flex 4 project. I understand that all business logic related to a View resides in the Presentation Model associated with that view, however, I am confused when it comes to View specific logic.For example, I have an indicator that needs to be positioned relatively to list items depending on which list item is selected. Is it acceptable in the Presentation pattern to put the logic that will position the indicator in the View and simply have that logic run in reaction to a selectedIndex property changing in the presentation model?The reason I am considering this is that since the Presentation Model does not have a reference to the view it is difficult to come up with an ideal solution for manipulating view components.
View 1 Replies
Mar 18, 2010
I am wondering how to make a 360º view bubble, like they use for Google Street View, but have no idea how to go at accomplishing this task... i have the string of photos that i attached in photoshop(so that if you connected the left to the right it would be a full 360º view).
View 1 Replies
Apr 23, 2010
main.mxml
[Bindable]
private var _dp:ArrayCollection = new ArrayCollection([
[code].....
View 1 Replies
Jun 19, 2011
I have 3 mxml components. In Component 1, I let the users fill in some data. In Component 3 I want to use the data, but I can't find a way to make it work.
View 1 Replies