Check the forum archives.  It depends on whether your SWF is an AS3 SWF or not. 
 The solution is different but possible either way.

 

If you set the source to another URL it will load it.

 

If you embed several SWFs you can simply refer to them because to embed several 
you'll probably do

 

[Embed('foo.swf")]

Var foo:Class;

 

And can just refer to foo.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of David 
Pariente
Sent: Friday, July 25, 2008 4:20 PM
To: flexcoders
Subject: [flexcoders] simple SWF dynamic loading and control

 

Hi all,

I'm trying to do something quite simple, but i couldn't for many days...guess 
should have asked for help before :(

I try to load some images from inside a SWF in order to use them as buttons.

I managed to load them, but i cannot control them, so they will just play, 
cause i can't even tell them to stop.

I guess i have no idea how to do this...so my code might be completely wrong.

I wish to do this through MXML tag as much as possible...even i might use an 
AS3 function on complete.

This is my code, i just try to make that loaded SWF to stop :(
Another question would be, how could I load that SWF movieclip dinamically, so 
i could change SWF contents without change the flex files? (design will change 
quite often while website online) I guess embedding it will just put content 
inside flex and compile it, but thats not what i want.



<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">
    <mx:Canvas x="341" y="159" width="200" height="232">
        <mx:Image 
            id="bt_pirate"
            source="@Embed(source='../flash/nk_web.swf',  symbol='abt_pirate')" 
 
            x="84" y="35"
            scaleContent="true" width="100%" height="100%" 
            horizontalAlign="center" verticalAlign="bottom"
            complete="{init_square(bt_pirate.content as MovieClip)}"
            />

        <mx:Script>
        <![CDATA[
 
        //import caurina.transitions.Tweener;
        import flash.display.MovieClip;

        public function init_square(sqimg:MovieClip):void {
    
            sqimg.stop();
            sqimg.scaleX=300;
            bt_pirate.content.stop();

        }

       ]]>
    </mx:Script>


    </mx:Canvas>
    
</mx:Application>


could someone help me???

 

________________________________


Enviado desde Correo Yahoo! 
<http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http:/us.rd.yahoo.com/evt=52431/*http:/es.docs.yahoo.com/mail/overview/index.html>
 
La bandeja de entrada más inteligente.

 

Reply via email to