Move the Main.mxml Variable to Pop.mxml

Hi all.

I have a project that has two files.

Main.MXML and Pop.mxml

Main.MXML is obv my main application and it has a variable that contains the link to an image.  This variable changes on a regular basis.

The Pop.mxml file is a TitleWindow I want to display the image, but on a larger scale.

My Pop.mxml code is like:

<? XML version = "1.0" encoding = "utf-8"? >
" < = xmlns:mx mx:TitleWindow ' http://www.Adobe.com/2006/MXML "
Layout = "vertical".
title = "Tazio audio"
showCloseButton = "true".
width = "1022".
height = "800".
Close = "titleWindow_close (Event); "move =" doMove (event) ">

< mx:Script >
<! [CDATA]
Import mx.events.CloseEvent;
Import mx.managers.PopUpManager;
Import mx.core.Application;

[Bindable] public var test: String;

private void titleWindow_close(evt:CloseEvent):void {}
PopUpManager.removePopUp (this);
}
private void doMove(event:Event):void
{//keeps TW inside the layout
var appW:Number = Application.application.width;
var appH:Number = Application.application.height;
if(this.x+This.Width>appW)
{
This.x = appW - this.width;
}
if(this.x<0)
{
This.x = 0;
}
if(this.y+This.Height>appH)
{
This.y = appH - this.height;
}
if(this.y<0)
{
This.y = 0;
}
}


[]] >
< / mx:Script >
< mx:SWFLoader width = '100 percent"height ="100% "source="swf/slide1.swf"/ >
< mx:Label text = "{test}" color = "#C00D0D" x = "1200" top = "20" / >

< / mx:TitleWindow >

What I'm struggling with you, is how to pass the Main.mxml variable to Pop.mxml.

I know how to do this with components, its easy enough, but I see no to make between these two files.

The vairable I am rying to spend at the momnet is called 'test'.

Any help would be great, thanks!

Hello

How you launch the popup, if you use PopupManager, try this

var popup:Pop = Pop(PopUpManager.createPopUp(this, Pop, true));
popup.test = "your value";
PopUpManager.centerPopUp(popup);

Tags: Flex

Similar Questions

  • How can I move the main library of FCPX sys HARD drive to another HARD drive

    I am a beginner FCPX...

    I use an SSD as diss system. I n ' love to load this SSD with such a library. Is it possible to move the main library on another hard drive?

    A big thank you to you all

    Michel

    Assuming that the middle is inside the library, just copy it to another disk and remove it from the SSD. It must be a Mac disk in format.

  • How to access the main .mxml file component control?

    I have a .mxml main while in which I imported custom "popUpWindow" component using the statement "import components.popUpWindow". In main .mxml file, I show more later this component in the form of pop-up window using the Popup Manager class:

    var popUpWin:IFlexDisplayObject;
    popUpWin = PopUpManager.createPopUp (Thi, popUpWindow, true);

    Once the component is displayed, how can I access using the actionscript component TextInput control (specifically the .text property) my main .mxml file?

    Thank you

    bdeen I think you have it bad: P I think he wants to access a property in the main application window.

    Give the textInput id and then on your main application you can do this for example:

    var test: String = popUpWin.textInputName.text;

    Please note that it is recommended to do a casting for the popup window:
    popUpWin = popUpWindow (PopUpManager.createPopUp (Thi, popUpWindow, true));

  • SWF external button to move the main timeline

    Hello

    I did a hand (parent) page that loads a swf that has a button (a1) which, when the click on I need to move the chronology of the parent

    I wrote this code to the external swf and tried many commands such as Object (root) .gotoAndStop (1);

    A1.buttonMode = true;

    A1.addEventListener (MouseEvent.MOUSE_UP, a1a);

    function a1a(event:MouseEvent):void {}

    }

    What should I write on the inside to make it work?
    Thanks in advance

    Try this:

    A1.buttonMode = true;

    A1.addEventListener (MouseEvent.MOUSE_UP, a1a);

    function a1a(event:MouseEvent):void {}

    trace (a1.parent.parent.parent);

    trace (a1.parent.parent);

    find the good timeline, possibly with more parent.parent... and then:

    MovieClip (a1.parent.parent.parent) .gotoAndtop (10);

    }

  • When I change the main mxml file in the project and then export the swf file does not change, why?

    I have an existing project, years ago that I need to change, I am using Flash Builder 4. When I export the project, it creates a SWF in bin-release, then when I change the code in the mxml project file or files of any format and export the swf file needs to change, but it's not. You have an idea why this might happen?

    Thank you

    I found the problem, there was a SWF into the html-template folder within the project. This has led to substitute the swf of the new generation.

  • How to access the elements in main.mxml file ActionScript?

    I'm having problems creating a panel using the Extension Builder SDK. It seems that all the examples explain how a CS5 document using a control panel, but I found no examples of how to control the items in the Panel via ActionScript code.   Furthermore, we use CS Extension Builder SDK with Flash Builder 4.  Here's a simple example of were I'm stuck.

    I create a project Extension generator for a panel of PS named: 'CSExtensionTest '.  In the main.mxml file create a button with id = "btnPSCode".

    ****************************************************************************************** *****************************************

    File:

    hand. MXML

    ****************************************************************************************** *****************************************

    <? XML version = "1.0" encoding = "utf-8"? >

    < mx:Application

    ' xmlns:mx = ' http://www.Adobe.com/2006/MXML " " layout ="absolute" historyManagementEnabled = "false""">

    < mx:Script >

    <! [CDATA]

    [

    Bindable ]

    private var hostName:String = HostObject.mainExtension;

    []] >

    < / mx:Script >

    "" < mx:VBox height = "100%" width ="100%" verticalAlign = "middle" horizontalAlign ="center">

    " < mx:Button id ="btnPSCode"label ="PS code run"click ="CSExtensionTestPhotoshop.run ()"enabled =" hostName.indexOf{('photoshop') >-1}"/ >

    " < mx:Button id ="btnJSXCode"label ="code JSX run"click ="CSExtensionTestJSX.run ()"/ > "

    < / mx:VBox >

    < / mx:Application >

    ****************************************************************************************** *****************************************

    How can I access the properties of this element in the CSExtensionTesJSX.as file?

    ****************************************************************************************** *****************************************

    File:

    CSExtensionTesJSX.as

    ****************************************************************************************** *****************************************

    package

    {

    Import com.adobe.csxs.core.CSXSInterface;

    Import com.adobe.csxs.core.csxs_internal;

    Import com.adobe.csxs.types.SyncRequestResult;

    Import mx.binding.utils.BindingUtils;

    Import mx.core.ButtonAsset;

    Import mx.core.mx_internal;

    Import MX.utils.object_proxy;

    public class CSExtensionTestJSX

    {

    public static function run():Sub

    {

    var myCSXS:CSXSInterface = CSXSInterface.getInstance ();

    var result: SyncRequestResult = CSXSInterface.instance.evalScript ('jsxFunction');

    btnPSCode.enabled = false;

    }

    }

    }

    ****************************************************************************************** *****************************************

    I get this error:

    image001.png

    I had initially written a panel using a Flex project and was able to access the properties of the items in the file main.mxml directly.  It seems that I can't do that.  Did I miss something in the code?  Am I missing some kind of library?  I'm sorry, I'm not very experienced in the development of Adobe, but we are trying to become more involved in the development of plugins and extensions for CS5.  Any help will be greatly appreciated.

    You must pass a reference to your object main mxml in the run method. For example:

    hand. MXML:


    http://www.Adobe.com/2006/mxml"layout ="absolute"historyManagementEnabled ="false">
       
           

    [Bindable]
    private var hostName:String = HostObject.mainExtension;
               
    ]]>
       
       
           
       

    testJSX.as:

    package
    {
    import com.adobe.csxs.core.CSXSInterface;
    import com.adobe.csxs.types.SyncRequestResult;
       
    Import mx.controls.Button;

    public class testJSX
    {
    public static void run(m:main):void
    {
    var result: SyncRequestResult = CSXSInterface.instance.evalScript ("jsxFunction");
    var b:Button = m.myButton;
    }
    }
    }

    HTH.

  • Flex IDE and use main.mxml

    Hi all

    I'm new to Flex ide, so I want to help with the design. I read Essential ActionScript 3.0. from Moock which does not explain the Flex ide, so I know (so far) only the programmatic issues.

    Question 1: Create a new project, Flex creates a main mxml. How can I set up an event here? To know how can I implement the MouseEvent.CLICK from the TextField component (create listeners, adding them in the TextField and so on)?

    Question 2: Suppose I want to implement a graphics class (descending Sprite), where I'll call him later, the time of execution. Can I use the Flex ide to design my class instead of typing all the stuff design by typing the code? I just the visual studio environment, where you can design your container 'View' (they have forms"to the vs) and the IDE vs implements under the hood the source code with the 'new' States, setting up values on properties, and so on. For example, you can open this code (this is a specific file) and change also. So, can I use the Flex ide to design my new graphics classes?

    Question 3: in general, which is the use of the main.mxml that contains design information?

    Take care!

    Dennis

    The way you want it!

    You can create a class that develop your .mxml class.

    You can create objects of this class...

  • Execution of function in the main Application component

    Hi all.

    I have my main.mxml application, with a component inside.  The component is called < ns1:record / > wearing the id "rec".

    This component has a function named doConnect(event:MouseEvent) inside.

    Now, I want to be able to add an event listener to a button on the Main.mxml that will perform the function inside the item when you click on it.

    I managed to add an event listener to the Main.mxml that triggers a function which is held in the Main.mxml when a button clicked inside the element is clicked.

    I did it using this code.

                <ns1:record id="rec" x="9" y="6" camera="{camera}" microphone="{microphone}" creationComplete="makeEvent()">
                </ns1:record>

     

                //Event listener
                public function makeEvent():void {
                    rec.backbtn.addEventListener(MouseEvent.CLICK,swapstate);
                }
                protected function swapstate(event:MouseEvent):void {
                    viewstack1.selectedChild=config;
                }

    No matter what I try you can't get do this the other way around.

    I need help what - by clicking on a button in the Main.mxml to perform a function within the Record element.

    If anyone can help that would be great!

    Thanks in advance.

    Hi djh88ukwb,

    From your post if I understand you correctly, you want to listen for an event by calling record when a main mxml button is clicked... on this basis

    hypothesis, I propose you a solution...


    http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete =" onCreationComplete () ">"

        
    private void onButtonClicked(event:MouseEvent):void
    {
    Rec.swapstate (Event);
    }
    ]]>



    public void swapstate(event:MouseEvent):void {}
    viewstack1.selectedChild = config;
    }

    Please try this and let me know...

    Thank you

    Jean Claude

  • How can I access a variable on the main timeline of a movie nested in HTML5 Canvas

    Hello

    This should be pretty simple, but for some reason, it does not work if I have the wrong syntax.

    But I have a movie clip with a bit of code in it.

    It is a timer.

    I want to be able to program the wait time: since the main scenario and that the timer read this variable on the main timeline.

    I implemented the delay var = 1000 on the main timeline, but then I do not seem able or knows how to get this variable in my code in the nested MC. It is quite difficult to find the reference of the paradigm flash timelines on H5 support pages, so I really appreciate the help.

    tl2 var = this;

    TL2. Stop();

    var delay = delayMain;

    var startTime is createjs. Ticker.getTime ();

    createjs. Ticker.addEventListener ("tick", f);

    {function equation

    If (createjs. Ticker.getTime () - startTime > delay) {}

    TL2. Play();

    createjs. Ticker.removeEventListener ("tick", f);

    }

    }

    If you want to get to a variable defined by a feature any at any depth, you can use the window. As:

    Window.Delay = value;

    in a deeply buried movieclip, can be read in any other level of the project.

  • How to move from data within the main application and many components

    HY people I am a newbie

    I created an application that uses 3 components created by me.

    The application main main, mxml have 3 buttons named AButton Bbutton Cbutton

    I pressed every button call one a large 3 components

    (I use ViewStack, to call each component after clicking each button)

    AButton invoke ComponentA

    BButton invoke ComponentB

    CButton call ComponentC

    My problem is how can I get (and use) in ComponetB the value of a public variable previosly

    created in the ComponentA.

    Thanks in advance

    Check this thread on the same subject

    http://forums.Adobe.com/message/2150870

  • Customize the FlexUnitApplication.mxml

    Hello!

    I'm trying to customize FlexUnit tests through Flash Builder 4.6. The main problem is to customize FlexUnitApplication.mxml.

    I want that Flash Builder generates by default FlexUnitApplication. Can anyone suggest where to find the model at this mxml?

    Thanks for any help.

    I'll answer my own question.

    The model is embedded in the java code in flexunit.jar. So one way to customize the model FlexUnitApplication.mxml is decompile this pot, change it and recompile.

  • How element access or a main mxml module method?

    Hello

    In my application, I created a module within which I said a button and the method. I can access these objects/menthods of main mxml?

    There was this doc for flex 3 very useful, not sure that if there is a version update for flex4, however the basic principles are still standing.

    http://blogs.Adobe.com/FLEXdoc/files/FLEXdoc/PDFs/modular.PDF

  • Communication with the main movie off external class

    Hello

    Hello, after recognizing that all my problems are as a result of the problem, I just start with AS3, having a litte experience with AS2 and common OOP. So, I try to understand the concept of AS3 on this level.

    My problems are mainly in the defined direction how outwardly objects communicate with the main movie.

    For example:

    (1) can I call a DisplayObject instance out of an external class, if this DisplayObject is defined and added to the display list in the MainMovie?

    2) can MovieClipObjects instance within a table, which works like an instance variable? I think that will cause trouble in the cascade of display list:

    {should be corner braces: class.} MovieClips {i} = new MovieClip();    -> root.class.MovieClips {1} Point separates it levels in the display list, but also object and attribute.

    Thank you

    the debugger does not recognize this error message?

    and if you want to clear the memory occupied by mc when you use:

    var a: Array = [];

    var mc:MovieClip = new MovieClip();

    a [0] = mc;

    use:

    If it was added, remove the mc of the displaylist.  remove all listeners and other references if there is.

    a [0] = null;  or a.shift (), if you do not have null in an array element.  Use a.splice (i, 1), if you used a [i] = mc;

    MC = null;

  • Change a State of main.mxml from a script in a different mxml

    Hello

    I am having trouble with my application, let's say I have the main application file called HAND. MXML

    in which I have defined different States and have different shapes.

    now, I have a form called loginForm that contains the element textInput Login and a password, I also have a link to register

    What onClick will change the State to display in the Panel even a registerForm of different shape (with items relevant textInput)

    now the HAND. MXML includes a custom component called < comp: NetworkManager / > which includes all the scripts of logic and MXML

    Tags for creating and managing a HTTPService request on a PHP server.

    When the user clicks on the "connect" button, it calls a function included in the main.as script (imported in HAND. MXML) which

    calls a function in the script within the NetworkManager.MXML passing all form data.

    NetworkManager.MXML the script will create an XML message, will be send to the PHP server, and wait for the response... If it comes

    Of course, the user is authenticated, is no different.

    well, I get the message, the back of the right answer. Now, I want to hide the MAIN form. MXML and put something like

    Welcome firstName lastName. instead. But I don't know how to do it. If I try to access States in HAND. MXML, of the NetworkManager.MXML

    I will get all sorts of errors that I have here with me.

    I know it sounds like a newbie question, and it's really... all licensee?

    your help is very appreciated.

    Thank you

    T.

    Hello

    Usually, the best way to do this sort of thing is to work with events. Defining a custom event is necessary which will store different types so that you will always know the nature of the event currently a reshipment. In your main application, simply add an event listener that subscribes to these events (example: this.addEventListener (ChangeEvent.LOGIN_FINISH, onLoginFinish), where "onLoginFinish" will be responsible for changing the status of the main application, and since this event listener is used in the main application, you don't have to worry about scope) and reacted accordingly.

    Thus, completion of the registration process you, you could simply send an event (example: dispatchEvent (new ChangeEvent (ChangeEvent.LOGIN_FINISH)) ;) spreads until the event listener that waits for it (since your NetworkManager is a part of the application main mxml, send your event will surely reach the listener), signaling this way a change in the application.)

    In case you're new on events then read on Adobe LiveDocs.

    Best regards

    Barna Biro

    PS: subedimadhav would be correct as just that events are much more elegant.

  • Control the main timeline of a movie via a button in a movie on another level.

    Hello!
    I have two film is at two different levels.
    Level 5 is my base film and I load another movie on top of that in level 10.
    Once the user clicks on a button in the movie to level 10, I would like to animation to level 5 to stop (the animation runs on the chronology of the main root of level 5).

    Once the user clicks a different button in the movie to level 10, I would like the animation in the main timeline of the movie in level 5 again from the moment it was already stopped.
    Is this possible?

    It would be great if someone could help me with this.
    Thank you, midi_ie

    You can't delete this loop of onClipEvent (enterFrame) unless you remove the movieclip to which it is attached. However, you can add an else if statement in your code (in addition to checking the variable Boolean "drag") to check if your _level10 button has been activated.

    and you can delete a slider.onEnterFrame loop, but you probably don't want to do.

    p.s. make the loop enterFrame?

Maybe you are looking for

  • HP4655: Print a chart in word

    Just go to this printer over the weekend.  I try to print a program to play in our school.  My last printer prints everything very well.  This one isn't.  In print preview, everything seems fine.  But when I print the program, the image on the first

  • the use of camera web usb on sbrio 9636

    Hello I want to use logitech camera / webcam C170 on single board rio sbRIO9636 to the perception of the vision. (a) is this unit supported by sbRIO9636, page on http://digital.ni.com/public.nsf/allkb/33131C00626C5B6E8625788D00025FC1 shows that the m

  • When I type on my laptop Everex Stepnote, get numbers instead of letters

    When I type on my laptop of stepnote everex (eg. I would be typing the Word windows and this is what would come out of w5n86ws) any suggestions? * original title - PORTABLE STEPNOTE EVEREX PRINT what HE LIKES? *

  • Printer stops working when you try to print.

    Original title: printer I have a wireless printer and my laptop keeps not working every day. I have uninstall the printer and then reinstall and it works again, I lost several articles because I cancel printing and reinstal and then the printer, try,

  • Give a higher priority than the wireless LAN / off wireless if LAN is connected

    Hello. What I want to do is quite simple: Im my office there is a fast LAN connection and a pretty poor wireless connection. Therefore, I want to say my device: "If there is a network cable is connected, simply use LAN." In this case, do not use Wifi