I am trying to creating a custom event in a actionscript class that will be 
distributed via a swc file.. 

I need to notify the parent application of when data is finished loading. 

Here is what I've been playing with: 

Class File: created as a Flex Library Project 
package com.adaption.instance 
{ 
import com.adaption.Adaption_SiteDetails_Structure; 
import flash.events.Event; 

public class Adaption_SiteDetails_ 
{ 
private static var instance:Adaption_SiteDetails_; 
public static function get siteDetail():Adaption_SiteDetails_ 
{ 
if (instance == null) 
{ 
instance = new Adaption_SiteDetails_; 
} 
return instance; 
} 
[Bindable] public var myInstance_SiteDetails:Object = new 
Adaption_SiteDetails_Structure; 

[Event (name="enableChanged", type="flash.events.Event")] 

public function createSiteDetail(dataObject:Object):void 
{ 
siteDetail.myInstance_SiteDetails.businessLine = dataObject.businessLine; 
siteDetail.myInstance_SiteDetails.businessPartnerID = 
dataObject.businessPartnerID; 
siteDetail.myInstance_SiteDetails.ccEnterpriceID = dataObject.ccEnterpriceID; 
siteDetail.myInstance_SiteDetails.ccGroupID = dataObject.ccGroupID; 
dispatchEvent(new Event("enableChanged",true)); 
} 

Application File: 
creationComplete="initApp(event)" // in the application header. 
private function initApp(e:FlexEvent):void 
{ 
valueOfBusinessPartner = 
Application.application.parameters.businessPartnerValue; 
valueOfAuthCode = Application.application.parameters.authCodeValue; 
valueOfAppiaWs = Application.application.parameters.appiaWsValue; 
if (valueOfAuthCode == "QA") 
{ 
header.lblConnectionType.text = "QA-build" 
} 
loadWsXML(e); 
loadBpXML(e); 
loadAcXML(e); 

bm = BrowserManager.getInstance(); 
bm.init("", "OfficeFone Dashboard - Site Administrator"); 
bm.setTitle("OfficeFone Dashboard - Site Administrator"); 
this.addEventListener("enableChanged", getSiteDetailsHandler); 
} 

Any one see where I've gone wrong or what I've missed? I tried putting 
<MetaData> tags around the Event method but no love , I've tired the 
MetaDataEvent (that the only option when I ctrl-SpaceBar) EventDispatch is 
soething else I've tired. 

Do I need to create a Custom Event Class in the library? or should I be doing 
this another way... 


I am trying to create a component libary to invoke a web service, store the 
data and send out a notification upon completion of the data retrieval. 

Thanks... 

Eric W Dunn 
Adaption Technologies 
281-465-3326 
[email protected] 

Reply via email to