Hello
here it is:
i have a flex file with methods inside and some as3 swf
The idea is to load the flex file in as3 swf, and when flex file is loaded, call a method from the flex file
here is the code process
var _loader:Loader = new Loader();
var flexAppli:URLRequest = new URLRequest("flexfile.swf");
_loader.contentLoaderInfo.addEventListener(Event.INIT, onLoadInit);
_loader.load(flexAppli);
and
[COLOR=#000000][COLOR=#006600]
private function [/COLOR][COLOR=#0000cc]onLoadInit[/COLOR][COLOR=#006600]([/COLOR][COLOR=#0000cc]event[/COLOR][COLOR=#006600]:[/COLOR][COLOR=#0000cc]Event[/COLOR][COLOR=#006600]):[/COLOR][COLOR=#0000cc]void
[/COLOR][COLOR=#006600]{
var [/COLOR][COLOR=#0000cc]loader[/COLOR][COLOR=#006600]:[/COLOR][COLOR=#0000cc]Loader [/COLOR][COLOR=#006600]= [/COLOR][COLOR=#0000cc]Loader[/COLOR][COLOR=#006600]([/COLOR][COLOR=#0000cc]event[/COLOR][COLOR=#006600].[/COLOR][COLOR=#0000cc]target[/COLOR][COLOR=#006600].[/COLOR][COLOR=#0000cc]loader[/COLOR][COLOR=#006600]);
[/COLOR][COLOR=#006600]var [/COLOR][COLOR=#0000cc]newSprite[/COLOR][COLOR=#006600]:[/COLOR][COLOR=#0000cc]MovieClip [/COLOR][COLOR=#006600]= new [/COLOR][COLOR=#0000cc]MovieClip[/COLOR][COLOR=#006600]();
[/COLOR][COLOR=#0000cc]newSprite[/COLOR][COLOR=#006600].[/COLOR][COLOR=#0000cc]name [/COLOR][COLOR=#006600]= [/COLOR][COLOR=#cc0000]"LeFlexCharge"[/COLOR][COLOR=#006600];
[/COLOR][COLOR=#0000cc]newSprite[/COLOR][COLOR=#006600].[/COLOR][COLOR=#0000cc]addChild[/COLOR][COLOR=#006600]([/COLOR][COLOR=#0000cc]loader[/COLOR][COLOR=#006600].[/COLOR][COLOR=#0000cc]content[/COLOR][COLOR=#006600]);
[/COLOR][COLOR=#0000cc]addChild[/COLOR][COLOR=#006600]([/COLOR][COLOR=#0000cc]newSprite[/COLOR][COLOR=#006600]);
[/COLOR][COLOR=#0000cc]setChildIndex[/COLOR][COLOR=#006600]([/COLOR][COLOR=#0000cc]newSprite[/COLOR][COLOR=#006600], [/COLOR][COLOR=#0000cc]0[/COLOR][COLOR=#006600]);
[/COLOR][COLOR=#ff9900]// here the method call[/COLOR][/COLOR][COLOR=#000000][COLOR=#006600]
[/COLOR][COLOR=#0000cc]newSprite[/COLOR][COLOR=#006600].[/COLOR][COLOR=#0000cc]mymethod();[/COLOR][/COLOR][COLOR=#000000][COLOR=#ff9900] //dont work[/COLOR][/COLOR][COLOR=#000000][COLOR=#ff9900]
[/COLOR][COLOR=#006600]} [/COLOR][/COLOR]
The problem is : when calling the mymethod from flex file, it does not work
So i did a trace on all elements in as3 file and i get an object like this
_MyFlexAppli_mx_managers_SystemManager
First question : What’s this ?
Second Question : How to call my method ?
Thx for yr help
tofu