Highlighted

How to Pass Variables from One Application to Another Pop Up Window

alice_data

17-11-2008

Hi,



I am wondering if anyone on the list has tried calling up a
pop up manager, and have two other variables imported for secondary
usage. I have tried using [Bindable], but this does not seem to be
working, and I am still getting errors that tells me that the
variables are "not defined" when it gets passed to another
HTTPService. I tried embedding the Pop Up Manager in the same
application as the one that is supposed to "pass the variables,"
but it no longer acts as a pop up window.



Could anyone please tell me where I can find the answers for
this?



Thanks in advance.



Here is the code of what I have for my pop up manager:



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

<mx:TitleWindow xmlns:mx="
http://www.adobe.com/2006/mxml"

layout="vertical"

title="New Scenario"

showCloseButton="true"

width="325"

height="145" horizontalScrollPolicy="off"

close="titleWindow_close(event);">

<mx:Script>

<![CDATA[

import mx.events.CloseEvent;

import mx.managers.PopUpManager;

import mx.controls.Alert;

[Bindable]public var message:String;

[Bindable]public var message2:String;

private function titleWindow_close(evt:CloseEvent):void {

PopUpManager.removePopUp(this);

}

private function submit_click():void {

Alert.show(scenario_name.text, "Alert");

new_scenario.send();

PopUpManager.removePopUp(this);

var win:Hello = PopUpManager.createPopUp(this,Hello, true)
as Hello;

PopUpManager.centerPopUp(win);

}



private function reset_click():void {

scenario_name.text = "";

}



]]>

</mx:Script>

<mx:HTTPService id="new_scenario" method="POST" url="
http://localhost/simulator/scenario.php"
useProxy="false">

<mx:request xmlns="">


<scenario_name>{scenario_name.text}</scenario_name>

<message>{message}</message>

<message2>{message2}</message2>

</mx:request>

</mx:HTTPService>

<mx:Form>

<mx:FormItem label="Scenario Name:">

<mx:TextInput id="scenario_name"

text=""

maxChars="45" />

</mx:FormItem>

</mx:Form>

<mx:ControlBar horizontalAlign="right">

<mx:Button id="submit"

label="Submit"

click="submit_click();" />

<mx:Button id="reset"

label="Reset"

click="reset_click();" />

</mx:ControlBar>

</mx:TitleWindow>

Replies

Highlighted

Karl_Sigiscar_1

18-11-2008

I don't exactly see what you are trying to accomplish, but if
you use a Singleton, you will be able to access it from anywhere
and get / set properties on it.

Highlighted

alice_data

18-11-2008

Hi,



I am trying to display some data on the Child window that
would need to take the data from the parent titleWindow, which
could be drop down menus, text labels or combo boxes. I would need
to use a HTTPService on the child dialog box to accomplish task I
think, but the problem is, how would I get the information from its
parent window? The example I have are all about how the text input
from the child window gets feed back to the parent.



Would I need to create a "reverse" declaration or something
so I can access the information from the parent in the child
window?



I hope this makes sense.

Thanks for your help.



Alice
Highlighted

Karl_Sigiscar_1

19-11-2008



By using a model with the Singleton pattern, everytime your
controls values change (drop down menus, text labels or combo
boxes), you can update the model. As it is accessible from
anywhere, the child window could also read these values.