Menu

[r236]: / cairngorm3 / trunk / libraries / IntegrationTest / src / CommandScopeSample.mxml  Maximize  Restore  History

Download this file

54 lines (43 with data), 2.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:popup="com.adobe.cairngorm.popup.*"
layout="vertical"
minWidth="1024" minHeight="768"
xmlns:commands="samples.commands.*"
addedToStage="buildContext()">
<mx:Script>
<![CDATA[
import com.adobe.cairngorm.popup.PopUpEvent;
import samples.commands.ParentContext;
import org.spicefactory.parsley.flex.FlexContextBuilder;
import org.spicefactory.parsley.core.context.Context;
[Inject]
public var context:Context;
private function buildContext():void
{
FlexContextBuilder.build(ParentContext, this);
dispatchEvent(new Event('configureIOC', true));
}
private function openingHandler(event:PopUpEvent):void
{
context.viewManager.addViewRoot(DisplayObject(event.popup))
}
private function closingHandler(event:PopUpEvent):void
{
context.viewManager.removeViewRoot(DisplayObject(event.popup))
}
]]>
</mx:Script>
<mx:Button label="Open popup 1" click="popup1.open = true" />
<mx:Button label="Open popup 2" click="popup2.open = true" />
<popup:PopUpWrapper id="popup1"
opening="openingHandler(event)"
closing="closingHandler(event)">
<commands:MyPopup/>
</popup:PopUpWrapper>
<popup:PopUpWrapper id="popup2"
opening="openingHandler(event)"
closing="closingHandler(event)">
<commands:MyPopup/>
</popup:PopUpWrapper>
</mx:Application>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.