@@ -36,6 +36,7 @@ package contents.displayPages
36
36
import flash.utils.getDefinitionByName ;
37
37
import flash.utils.getQualifiedClassName ;
38
38
import contents.displayElements.SaffronPreLoader ;
39
+ import appManager.event.AppEventContent ;
39
40
40
41
/**Reload required*/
41
42
[Event (name="RELOAD_REQUIRED" , type="contents.displayPages.DynamicLinksEvent" )]
@@ -66,12 +67,34 @@ package contents.displayPages
66
67
private const linkSensorDebug: Number = 0.0 ;
67
68
68
69
protected var myPageData: PageData ;
70
+
71
+ private var _itemSelected : Function ;
69
72
70
73
/**This is the DynamicLinks current page data*/
71
74
public function get pageData ():PageData
72
75
{
73
76
return myPageData
74
77
}
78
+
79
+ /**You will receive linkData on this function */
80
+ public function onItemSelected (itemSelected :Function ):void
81
+ {
82
+ _itemSelected = itemSelected ;
83
+ this . removeEventListener (AppEventContent. PAGE_CHANGES ,catchPageChange);
84
+ this . addEventListener (AppEventContent. PAGE_CHANGES ,catchPageChange);
85
+ }
86
+
87
+ private function catchPageChange (e :AppEventContent ):void
88
+ {
89
+ if (_itemSelected != null )
90
+ {
91
+ e. stopImmediatePropagation ();
92
+ if (_itemSelected . length == 0 )
93
+ _itemSelected ();
94
+ else
95
+ _itemSelected (e. linkData);
96
+ }
97
+ }
75
98
76
99
protected var sampleLink: LinkItem,
77
100
linkClass: Class ;
0 commit comments