Flex :: Get The Value From An Mxml To Another (child To Parent)?

Aug 15, 2011

how do I get a value from another mxml.I have a vaule in the child mxml that i would like to parse to the parent mxml.Then use the vaule to create a search method.

View 1 Replies


Similar Posts:


Flex :: Load An External Mxml File Into A Parent Mxml File?

Mar 9, 2012

This is a project I'm working on for a simple demo tutorial application in Flex. I am using mxml pages. You can see to the left that I will have my main application and then other mxml files (In the Examples Package) as the examples that will be loaded into the main application mxml. How can I dynamically pull the value from the object in the list to load the child mxml file into the container that I have further down in the application?

View 1 Replies

Flex :: Extending Mxml Component With From Another Mxml Component With Visual Child Supported?

May 18, 2011

I've been trying to create a custom mxml component that extends another custom mxml component (i.e.MyMXMLComponent -> BaseMXMLComponent -> Group). I've been reading that trying to add visual children to MyMXMLComponent caused error with Flex 3 but that's no longer the case with Flex 4.

What I want to know is whether this is a supported/fixed/documented feature of Flex 4? or just some undefined behavior in Flex 4 that may get changed with future updates?

if this is supported and documented feature, does anyone have link pointing to adobe document stating it as such?

View 1 Replies

ActionScript 3.0 :: Parent.removeChild(child) Doesn't Update Parent Width / Height When Child Was Rotated

Jul 29, 2011

I got a Parent Sprite, let's name it SpriteP, which holds inside it two other Sprites. Sprite1 and Sprite2.[code]Sprite2 is a rectangle. When I rotate it, of course, the height of its parent, SpriteP, GROWS. But I would expect that height to go back to what it should be when I'm removing Sprite2!And it does! If I remove Sprite2 while NOT being rotated, the height of the parent drops back to normal, 200.

View 10 Replies

ActionScript 3.0 :: Child-parent Relationship \ Adding Them All As Children Of The Stage And Creating A Parent-child Hierarchy Between Them?

Jun 6, 2011

i am slightly confused about the parent and child relationship. lets assume we have several different instances, what would be difference of adding them all as children of the stage and creating a parent-child hierarchy between them(other than the access path).

View 5 Replies

ActionScript 3.0 :: Parent.removeChild(child) Doesn't Update Parent Width/height When Child Was Rotated

Jul 29, 2011

I got a Parent Sprite, let's name it SpriteP, which holds inside it two other Sprites. Sprite1 and Sprite2.

When Sprite2 is NOT rotated:

Code:
trace(SpriteP.width + ' ' + SpriteP.height); //100 250.
SpriteP.removeChild(Sprite2)
trace(SpriteP.width + ' ' + SpriteP.height); //100 200. -> works, 200 is good.
When Sprite2 is rotated at 90:

[Code].....

And it does! If I remove Sprite2 while NOT being rotated, the height of the parent drops back to normal, 200. But if I rotate Sprite2, the Parent won't update its bounds.

View 1 Replies

Flex :: Mxml - Dynamically Resize Parent Container To Contain Children

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

Flex :: Fill Parent In Adobe / MXML - Implementing Layout?

Dec 6, 2011

I am attempting to implement a layout in Adobe Flex 4.5 / MXML where I have multiple controls in an HBox that - in total - consume all available horizontal screen estate. Some use a relative with (percentage), some an absolute width (pixels) and one is supposed to consume whatever space is still left, such as:

+----------------------+-----------------------+------+
| 35% | fill parent | 10px |
+----------------------+-----------------------+------+


How would I achieve this in Flex (is there something comparable to Android's
layout_width="fillparent")?
Due to the fact that there are elements that have an absolute width I cannot easily calculate the width of the filler as a percentage a priori (as it varies with the screen width). Setting the filler's width to 100% also does not work as this will shrink the 35% area below 35%. Applying the updateDisplayList suggestion from www.Flextras.com's answer below yields the error "Call to a possibly undefined method updateDisplayList" at the line marked in the source excerpt below:

<?xml version="1.0"?>
<mx:HBox xmlns:fx="[URL]"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationPolicy="auto"
[Code] .....

View 1 Replies

Flex :: Static / Private Child Component In Mxml?

Oct 14, 2009

Are there any way to declare a child component in mxml which is private/protected or even static? Sure we can do this inside a script tag, but are there any other way?

View 2 Replies

Flex :: Adding MXML Component As Child Of Main App Using AS

Apr 26, 2010

How can I add an MXML component as a child of the main application using ActionScript. It's not possible to instatiate it, is it? Assuming that behind every mxml file stands an actionscrpt3 class, I tried to import it but id didn't show up.

View 1 Replies

Flex :: Put MXML Child Nodes Within A Custom 4 Component?

Nov 27, 2010

Here is an example of a custom component. It is just a box with a title label and a close image (X):

[Code]...

When using the component in an MXML document, I would like to have the "(HEADING TEXT)" replaced with a parameter (should be easy) as well as the "(INSTANCE MXML)" with several labels, text inputs, check boxes, etc. (maybe harder). I have found this script-based method, but I would like a cleaner compile-time solution if one exists.

View 2 Replies

Flex :: Child Elements Of MXML Class Not Appearing?

Mar 4, 2011

I'm working on a simple task/calendar tool where tasks can be added dynamically to a canvas. Here is the main application as defined in Main.mxml, which is essentially just a Canvas and a button for adding a task:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Canvas id="MainCanvas" borderStyle="solid" width="300" height="300">

[Code].....

The problem is that when I add a Task instance to the Canvas, the children (the button and label) don't appear. I tried setting creationPolicy="all" on both the Canvas and the BorderContainer, but it still didn't work. I've read a bunch of posts about people having issues accessing members of their class before the class is fully loading, but all I want to do is SEE that Label and Button show up inside the BorderContainer.

View 2 Replies

ActionScript 3.0 :: Positioning Parent MC In Order To Center Child MC On Parent's Parent MC

Feb 5, 2010

[code]All clips are squared.Ok, on the PlayerPlane, there are little soldiers, which have hotkeys. The effect I'm trying to create is I want to position the GameStage so that the currently selected soldier appears in the center of the GameClicker clip.The GameStage is movable by the player (to scan other areas of the map)by holding the CTRL key, so it's easy to kinda lose track of where your players are.I have tried using localTo Global and globalToLocal techniques, but I think I'm lost on the actual math of getting the GameStage to move the correct distance so that the selected soldier is centered to the GameClicker.[code]

View 2 Replies

Flex :: Mxml - UIMovieClip Modify The Width Of A Child DisplayObject

May 11, 2011

I have a collection of UIMovieClip components which reside in an s:HGroup tag. In ActionScript code I am modifying the width of a child clip in one of the UIMovieClips but these changes are not reflected by the s:HGroup.

<s:HGroup id="_buttonGroup">
<uiassets:NavigationTabButtonSWC id="_lobby" />
<uiassets:NavigationTabButtonSWC id="_achievements" />

[Code]....

View 1 Replies

ActionScript 3.0 :: Remove Parent.parent.parent Child?

Jan 3, 2010

I got a "preloader" that creates an movieclip and loads an SWF. Now in the loaded SWF i want a close button to go back to the "preloader". The preloader isn't an actuall preloader but some sort of mainclip.Now i tried this:removeChild(MovieClip(e.currentTarget).parent.pare nt.parent)But i get error:ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.at flash.display::DisplayObjectContainer/removeChild()at MethodInfo-6()

View 1 Replies

Flex :: Force A Resize From A Child To A Parent?

Jul 22, 2009

I have a page-like flex application. In my main application is a holder (a canvas) that displays all the pages. The problem is that the components that are loaded inside the holder are bigger than the holder is when the main application starts. The holder height is set to 100% but still he gets scrollbars when I load a bigger component inside of him then himselHow can I solve this problem? And if it isn't solvable would it work correct if I use a viewstack?the holder looks like this:

<mx:canvas height="100%">
</canvas>

But the end of the application is 500 pixels lower so canvas height is 500 pixels high. Now I put a new child inside the holder that is 1000 pixels high.

View 2 Replies

Flex :: Move The Child Only Inside The Parent?

Feb 4, 2010

Recently I worked in a project using Flex. Its a Photo editing project. I have took a Canvas and take a image in that canvas using the code canvas.addChild(image) . Now i can move the image freely by using moving code. The image move inside the canvas and outside the canvas. I want to move the image/child only inside the canvas not outside. How can i do this?

View 1 Replies

Flex :: Call Child Function From Within Parent?

Jun 1, 2011

Is it possible to call a child function from within the parent? I know to go child > parent, you can do parentApplication.functionName(parameters);, but what about going the other way... that is parent > child?

View 2 Replies

Flex :: Parent Not Executing Child's Function

Jun 7, 2011

I have a main.mxml, child.mxml and headermenu.mxml. I click a button on the headermenu that dispatches an event up to the main.mxml which then executes a method in child.mxml. I know this works because I put an AlertDialog in the function I'm calling inside of the child.mxml. The child.mxml contains a drawingArea object that has an erase(). When I call this directly from child.xml it executes, however if I put drawingArea.erase() inside of the function being called by child's parent (main.mxml) nothing happens.[code]...

View 1 Replies

Flex :: How To Access Variable In Parent Component From Child

Sep 18, 2010

I have a public variable set within fx:Script tags in a parent component that I'd like to access directly from a child component. How can I do this? I don't want to pass the variable to the child component (I know how to do this and am currently using this approach). Following is a simplified version of the mxml:

Note: SimpleComp is an HBox with a couple of lists.
<mx:Accordion>
<comp:SimpleComp/>
</mx:Accordion>

View 4 Replies

Flex :: Null Cast Between Parent And Child Objects?

Mar 1, 2011

I have a flex application with two objects: a parent widget (called an IBaseWidget) and a child widget (called a HelperWidget2).When the user clicks on a help link, a helper widget is loaded into the list of base widgets and then displayed for the user.However, when I try to access this child widget by casting the base widget in the collection to the child widget type,the child widget returns null and I am unable to work with the widget.The following snippet correctly returns the widget ID of the newly added widget and dispatches an event to load the widget:

var id:Number = WidgetManager.getInstance().getWidgetId("Helper");
ViewerContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_RUN, id, openQuickQueryCanvas));[code].........

The problem is that helperWidget above always returns null, meaning the cast isn't successful.

View 1 Replies

Flex :: Does Disabling Parent Component Affect Its Child?

Aug 30, 2011

I have many buttons in HBox. Instead of disabling each button, I've disabled HBox. But I am able to click buttons even though the HBox is disabled. Disabling parent component will not make difference on its child? it shows like disabled but mouse events will generate.

View 1 Replies

Flex :: Actionscript 3 - Detect The Child Element Of A Variable Parent In E4X?

Jul 20, 2009

I have XML that looks like this:

<question>
<type_elt>
<opt_out_flag />
</type_elt>
</question>

type_elt is not an element name; it might be <single>, <multiple> or something else, determined at runtime. How, given this, can I detect the presence of the opt_out_flag element?

I tried this (where xml refers to the question element):

if (xml.*.opt_out_flag) {
do_something();
}

but even in cases without opt_out_flag the above expression returns true. Obviously I'm missing something, but what is it?

View 5 Replies

Flex :: Play Resize Effect On Parent Before Adding Child To It

Apr 19, 2010

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 within a HBox directly under the addChild tag, it works fine. However, if I create a new component with the same code (HBox with two buttons in it) and then add the new component to the panel (Comp in the code commented), it won't show the resize effect.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">

[Code].....

View 1 Replies

ActionScript 3.0 :: Add A Clip To The Stage As A Child And Remove The Parent And Set The Parent Equal To Null?

Sep 11, 2010

if I add a clip to the stage as a child and remove the parent and set the parent equal to null, does the child get collected and removed from memory? What if the child has an image loaded into it as its child? 

In my application I'm loading a series of png images as overlays that can be tinted for customizing in this app. When I trace my memory, the basic app idles at 64,000 k. The exact second I load those overlay images it goes up to 205,000k. If I remove those clips and "clear" the stage I should go back down to 64,000 k if everything is removed and collected correctly, right? It's not, it's hanging at 215,000 k. Are my images being cached and that is the reason for the memory staying up? If so, how do I prevent that. Or upon removing the parent of the image how can I un-cache the image.

If a user switches between models and loads several different items then the application actually crashes the Flash environment because of too much memory usage. It also does the same to browsers.

View 29 Replies

ActionScript 3.0 :: Tab Indexing Loop Through Parent, External Child Swf, Back To Parent?

Nov 11, 2009

I have a parent swf which loads many child swfs (though only one is displayed at a time). My intention was to use the loaded SWFs document class to retrieve an array of objects to be assigned a tab index, combine this with the parent's own array of objects and apply sequential tab indices to them all. But what happens is actually that the parent's objects are assigned an index, but the external swf is unaffected. In fact, the external swf retains its automatic tab indexing, when I would expect that having set a value for InteractiveObject.tabIndex, automatic tab indexing would be disabled.

I've seen similar tales elsewhere. Most posts I've read are wanting to load an external swf, give it focus and loop through those objects, then close the swf and return to looping through the parent. However I would like loop through all objects as one. including manipulating the focus manager(s), and basically fiddling with every tab-related property I know.

View 2 Replies

Flex :: Why Does Matrix Transform Snap Child Back To Top Corner Of Parent

Apr 14, 2011

I'm having trouble with Matrix Transforms in Flex.

I have a Flex Canvas with nothing but an Image in it, like so.

<mx:Canvas>
<mx:Image id="img" source="/some/Url" />
</mx:Canvas>

[Code].....

View 5 Replies

Unable To Send Variable From Flash(parent) To Loaded Flex Swf(child)?

Mar 27, 2012

i am trying to load the variables from parent(flash) to child(flash).Its working fine,.

parent swf:(flash)
var parentMessage:String = "Hello";
var swf:MovieClip;
var l:Loader = new Loader();

[Code].....

View 4 Replies

ActionScript 3.0 :: SetChildIndex And SwapChildren - On Mouse Over Set The Parent Of The Moused Over Text Field To The Highest Depth Child Of Its Parent

Sep 29, 2011

trying to on mouse over set the parent of the moused over text field to the highest depth child of its parent i tried both of these: [code] private function

[Code]...

View 3 Replies

Actionscript 3 :: Assign A Parent's Variable From The Parent's Child?

Nov 7, 2011

i want to pass the variable from parent to child .How Can i pass the Variable.Here i paste my code.

My Parent Class

public class PlayerStrobe_domaincheck extends Sprite
{
private var myService:NetConnection = new NetConnection();
private var _loader:Loader;

[Code]....

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved