kbnordvest
asked on
call function in module
I am trying to call a function inside a module, from the application.
How is this done?
How is this done?
--- The function in the main application ---
public function cartUpdater():void {
cartU();
}
--- The function in the module ---
public function cartU():void {
serviceCartList.send();
}
Argh ... dont' implement that in the main module, but in the module you want to call the function on ... sorry for that.
ASKER
I have made the interface and imported it into the main application and the module, where i want to call the function. However i get the following error, when i call the function. I also don't know how and where to incert the "implements" attribute.
TypeError: Error #1034: Type Coercion failed: cannot convert shop_cart_small$ to shop_cart_small_update_int erface.
at shop_item_view/cartUpdater ()
at mnvitmr::shop_item_tic/inC art_clickH andler()
at mnvitmr::shop_item_tic/__i nCart_clic k()
TypeError: Error #1034: Type Coercion failed: cannot convert shop_cart_small$ to shop_cart_small_update_int
at shop_item_view/cartUpdater
at mnvitmr::shop_item_tic/inC
at mnvitmr::shop_item_tic/__i
I created a small flex project demonstrating everything.
Unfortunately it took me twice as long to somehow provide the file as EpxertsExchange super intelligent file-scanner doesn't allow uploading fxp Files. It allways complains about content not being allowed. I therefore uploaded the File to my confluence and you can get it from there ... http://dev.c-ware.de/confluence/display/PUBLIC/Experts+Exchange+Files)
Hope it helps.
Chris
Unfortunately it took me twice as long to somehow provide the file as EpxertsExchange super intelligent file-scanner doesn't allow uploading fxp Files. It allways complains about content not being allowed. I therefore uploaded the File to my confluence and you can get it from there ... http://dev.c-ware.de/confluence/display/PUBLIC/Experts+Exchange+Files)
Hope it helps.
Chris
ASKER
Great example, and easy to follow.
I can se you use the mx:ModuleLoader. I have been inserting my modules, as you can se in the attached code. Is it possible to get the interface to work with this?
I can se you use the mx:ModuleLoader. I have been inserting my modules, as you can se in the attached code. Is it possible to get the interface to work with this?
<ns1:shop_cart_small x="800" y="32">
</ns1:shop_cart_small>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This has been a great learning experiance.
ASKER
Thanks. I doubled the points.
public function cartUpdater():void {
MyCoolInterface (modObj).cartU();
}
Open in new window