Thanks!!! It did the job. =) I refactored my application a little and incorporated your code into it... now it works smoother.
Thanks for the help! Cheers, On Thu, Jul 17, 2008 at 2:50 AM, Alex Harui <[EMAIL PROTECTED]> wrote: > The modules presentation describes appdoms and shared code problems. > > > > ________________________________ > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of Guilherme Blanco > Sent: Wednesday, July 16, 2008 7:40 AM > To: flexcoders@yahoogroups.com > Subject: Re: [flexcoders] Error #1034: Type Coercion failed.... how to > solve? > > > > Could you please point me to the right post? > > I've looked at this page (after researched Google for your blog), and > could not find it... http://blogs.adobe.com/aharui/ > > Thanks in advance, > > On Wed, Jul 16, 2008 at 11:33 AM, Alex Harui <[EMAIL PROTECTED]> wrote: >> Shared code problem. See my blog >> >> >> >> ________________________________ >> >> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On >> Behalf Of Guilherme Blanco >> Sent: Wednesday, July 16, 2008 7:19 AM >> To: flexcoders@yahoogroups.com >> Subject: [flexcoders] Error #1034: Type Coercion failed.... how to solve? >> >> >> >> Hi all, >> >> I'm in troubles here... researching the internet furiously while post it >> here. >> I have in my application that loads a module and instantiate it inside >> an instance of class core.controls.ModalDialog, class that I wrote >> extended from TitleWindow. >> >> The source is really simple... here is the implementation of module load >> event: >> >> protected function handleCreateCompanyModuleLoad(event:ModuleEvent):void >> { >> var dialog:ModalDialog = >> ModalDialog(PopUpManager.createPopUp(Application(Application.application), >> ModalDialog, true)); >> >> // Dialog customization >> dialog.title = "Create Company"; >> dialog.width = 450; >> dialog.height = 270; >> dialog.showCloseButton = true; >> >> // Dialog content customization >> var ui:* = event.module.factory.create(); >> dialog.addChild(ui); >> } >> >> One of the buttons inside the module closes the ModalDialog, which >> should be accessible through this.parent or this.owner. Since I know >> I'm always inside of it, I cast the property to prevent Flex from >> popping my errors... >> >> <mx:Button label="Cancel" click="close();"/> >> >> protected function close():void >> { >> //ModalDialog(parent).close(); >> ModalDialog(owner).close(); >> } >> >> Everytime I execute the code and click in the "Cancel" button... it >> throws this runtime error: >> >> TypeError: Error #1034: Type Coercion failed: cannot convert >> core.controls::[EMAIL PROTECTED] to core.controls.ModalDialog. >> >> Any ideas how do I solve this? >> >> PS: Inside the application module (it's 100% modular) I already >> imported the ModalDialog and inside the module too.... researching the >> internet I saw someone telling that missing this might be a problem >> (solved the requester' issue), but didn't have any effect for me... >> >> []s, >> >> -- >> Guilherme Blanco - Web Developer >> CBC - Certified Bindows Consultant >> Cell Phone: +55 (16) 9166-6902 >> MSN: [EMAIL PROTECTED] >> URL: http://blog.bisna.com >> Rio de Janeiro - RJ/Brazil >> >> > > -- > Guilherme Blanco - Web Developer > CBC - Certified Bindows Consultant > Cell Phone: +55 (16) 9166-6902 > MSN: [EMAIL PROTECTED] > URL: http://blog.bisna.com > Rio de Janeiro - RJ/Brazil > > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9166-6902 MSN: [EMAIL PROTECTED] URL: http://blog.bisna.com Rio de Janeiro - RJ/Brazil