Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Run Child Function From Swf Loaded To Image Tag
tfcenturion
post Apr 28 2009, 11:39 PM
Post #1


Member
**

Group: Members
Posts: 10
Joined: 4-December 08
Member No.: 2,878



Hi Everyone,

Yes another problem to resolve. laugh.gif


This time what im trying to do is run a function from a swf file that has been loaded into a imge tag..

mxBody is the <mx:Image> tag.

mxBody.source = "images/avatar.swf";

the function id like to run would be colour.

So im thinking it would be something like mxBody.source.colour(); but this gives me an error.

Anyone able to help on this issue.

Paul..
Go to the top of the page
 
+Quote Post
tfcenturion
post Apr 30 2009, 10:02 AM
Post #2


Member
**

Group: Members
Posts: 10
Joined: 4-December 08
Member No.: 2,878



Hi all, wink.gif

I, with help from another forum, was able to resolve this issue too.

OK, heres how i did it.

The Child SWF had to have a document .as attached to it and the actionscript placed in there, it was so the parent would see the class bit probs.

then in me Flex App i had
CODE
mxBody.source = "images/avatar.swf";
mxBody.addEventListener(Event.COMPLETE, swfLoaded);

and yes, swfLoader would have worked here too.


and the swfLoaded Function was
CODE
private function swfLoaded(e:Event):void
{
    // SWF file has completed loading, Run functions from it. //
    Object( e.target.content ).colourSkin( 0xFF0000 );
}


Hope this help others..

Paul
Go to the top of the page
 
+Quote Post
Stefan Mitchell
post Apr 30 2009, 02:00 PM
Post #3


Advanced Member
***

Group: Moderators
Posts: 83
Joined: 6-July 08
From: Reykjanesbær, Iceland
Member No.: 689



glad you got it sorted out =)

I wouldve helped ya if I knew anything about action script..

peace-


Mitch.


--------------------
A proud CartoonSmart student since 2005!.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Time is now: 10th September 2010 - 07:50 AM