Hi there,
I'm trying to catch
an event from a Flex 2 App that is embedded in my app. I'm using a
SWFLoader to embed the swf file and I'm using SystemManager to communicate back
and forth.. Except the communicate is one way at the moment! If anyone has any
suggestions, that'd be great!
Thanks,
Pete
Here's the
code:
// Parent
App
<?xml
version="1.0" encoding="utf-8"?>
<mx:Canvas
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:mx="http://www.adobe.com/2006/mxml"
height="100%"
width="100%">
<mx:Script>
<![CDATA[
import
mx.managers.SystemManager;
[Bindable] public var quizSM:SystemManager;
private function completeHandler():void {
mx.controls.Alert.show('huzzah!');
}
private function initNestedQuiz():void {
quizSM = SystemManager(quizLoader.content);
quizSM.application.addEventListener("complete", completeHandler); // this code is not working!
}
[Bindable] public var quizSM:SystemManager;
private function completeHandler():void {
mx.controls.Alert.show('huzzah!');
}
private function initNestedQuiz():void {
quizSM = SystemManager(quizLoader.content);
quizSM.application.addEventListener("complete", completeHandler); // this code is not working!
}
]]>
</mx:Script>
<mx:SWFLoader id="quizLoader" width="100%" height="100%" source="/Quiz/QuizContainer.swf"/>
</mx:Canvas>
<mx:SWFLoader id="quizLoader" width="100%" height="100%" source="/Quiz/QuizContainer.swf"/>
</mx:Canvas>
// Nested
App
<?xml
version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Metadata>
[Event(name="complete", type="flash.events.Event")]
</mx:Metadata>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function quizComplete(event:Event):void {
Alert.show('Completed in Quiz');
var event:Event = new Event("complete");
this.dispatchEvent(event);
}
]]>
<mx:Metadata>
[Event(name="complete", type="flash.events.Event")]
</mx:Metadata>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function quizComplete(event:Event):void {
Alert.show('Completed in Quiz');
var event:Event = new Event("complete");
this.dispatchEvent(event);
}
]]>
<!-- Views are here that call
quizComplete -->
</mx:Application>
</mx:Application>
Pete Capra
Information Systems Coordinator
National
Institute of Training
p. (617) 3208 9455
m. 0411 043 305
f. (617)
3208 9855
a. PO Box 1744 Springwood Q
4127
www.niot.com.au
[EMAIL PROTECTED]
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Software development tool | Software development | Software development services |
Home design software | Software development company |
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___