CenterPopUp will validate the popup which runs the creationComplete
handler before you've set the variables.

 

________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt
Sent: Monday, October 01, 2007 3:05 PM
To: [email protected]
Subject: RE: [flexcomponents] Passing varaibles to a Popup window Tracey
Spratt style

 

The problem is not in the data Passing, but somewhere else. I took your
code, stripped out everything but the data passing stuff, and the data
was passed in fine.

You need to debug this to determing where the problem is.

Create a button, and use it to call showMessage with hard coded values:
<mx:Button label="Test Popup" click="showMessage('test',6000)"/>

Tracy

-----Original Message-----
From: [email protected]
<mailto:flexcomponents%40yahoogroups.com> 
[mailto:[email protected]
<mailto:flexcomponents%40yahoogroups.com> ] On Behalf Of candysmate
Sent: Thursday, September 27, 2007 5:47 PM
To: [email protected]
<mailto:flexcomponents%40yahoogroups.com> 
Subject: [flexcomponents] Passing varaibles to a Popup window Tracey
Spratt style

Tracey Spratt very kindly posted a tutorial demonstrating passing
variables between the application and a popup window without events.
I've used this technique extensively in my own apps and am grateful to
Tracey for posting it.

However, I'm having trouble using this technique now for some reason.
Here's my code which isn't passing the data at all. Anyone spot my
bloopers please?

Popup titleWindow code:

<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
layout="absolute" width="596" height="134" title="Attention:"
titleIcon="@Embed(source='/images/alarmicon.png')"
styleName="alertStyle" creationComplete="setTimer();">
<mx:Style>

.alertStyle {
font-family: Verdana;
flashType: true;
font-weight: normal;
color: #000000;
font-size: 18pt;
background-color: #FF9999;
border-color: #FF9999;
roundedBottomCorners: true;
cornerRadius: 15;
borderStyle: solid;
}

</mx:Style>
<mx:Script>
<![CDATA[
import ssp.debugging.TraceWindow;
import flash.utils.Timer;
import mx.managers.*;
public var timer:Timer;

public var tw:TraceWindow = new
TraceWindow("tw");

[Bindable]
public var messageString:String; 

[Bindable]
public var messageDuration:int;


private function setTimer():void
{

tw.title = "String:";
tw.visible = true;
tw.trace(messageString);
// var stringArray:Array =
messageString.split("|");

alertMessage.text = messageString;
timer = new Timer((messageDuration * 1000), 1);
;
timer.addEventListener(TimerEvent.TIMER,
onTimer);
if (timer.running)
{
timer.stop();
}
timer.start();
}

private function onTimer(event :
TimerEvent):void
{
PopUpManager.removePopUp(this);
}

]]>
</mx:Script>
<mx:Label x="10" y="30" textAlign="left" fontSize="18"
id="alertMessage" text=""/>

</mx:TitleWindow>

Main app MXML:

public function showMessage(messageItem:String, messageDuration:int):
void
{


var alertInstance:alertPopupDialog =
alertPopupDialog(PopUpManager.createPopUp(this,
alertPopupDialog,
true)); //instantiate and show the title window

PopUpManager.centerPopUp(alertInstance);
alertInstance.messageString = messageItem
alertInstance.messageDuration = messageDuration;


}

no data makes it to the Popup Window.

Yahoo! Groups Links

 

Reply via email to