AS3: embeded audio in loaded SWF

i'm trying to update an AS2 swf/audio player to AS3 and
running into trouble. i'm exporting an embedded mp3 as a Sound
object, then loading that SWF into a player engine that is
skinnable... is there anyway to treat the SWF as a streaming sound?
Having to wait until the Loader INIT event fires isn't really gonna
work...
i had attempted encoding the audio as FLV, which was working
great with FLVPlayback - until you do anything to the browser
window (like resizing) which causes erratic sound playback. not
cool...
thanks!!!!!

to stop all movieclips use:
var imageReq:URLRequest = new URLRequest("square.swf");
var imageLoader:Loader = new Loader();
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);
imageLoader.load(imageReq);
function loadHandler (event:Event)
    var myClip:MovieClip = event.currentTarget.loader.content
    addChild(myClip);
    stopAllF(myClip);
function stopAllF(mc:MovieClip):void{
mc.stop();
for(var i:int=0;i<mc.numChildren;i++){
if(mc.getChildAt(i) is MovieClip){
MovieClip(mc.getChildAt(i));

Similar Messages

  • Using embeded fonts in loaded swf.

    I have a .Swf, which has 3 fonts embedded in it, they are all exported in frame 1 for AS.  This swf loads any number of external .swfs which have dynamically generated textfields inside of them.  This text must be embedded text because effects may be applied to them.  I do not want to embed the three fonts into every external swf, and do not think I should have to.  The font exists in the Loading swf and I have registered the fonts to the global font list.  If I print this list from the loaded swf, all three fonts are present, but when I try to use any of them, my textfiels are empty.
    My question is how do I utilize a font which is embedded in a swf, from a swf which has been loaded into that swf?
    From my external swf, this code:
    [PHP]var embeddedFonts:Array = Font.enumerateFonts(false);
    embeddedFonts.sortOn("fontName", Array.CASEINSENSITIVE);
    trace(embeddedFonts);[/PHP]
    produces the following:
    [PHP][object CenturyBook],[object MyriadProRegular],[object MyriadProItalic][/PHP]
    which are the three fonts that are embedded in the loading swf, So I assume the LOADED swf has access to these fonts.
    When I apply this code to the externally loaded swf:
    [PHP]var FontClass:Class = getDefinitionByName("MyriadProRegular") as Class;
    trace("FontClassInstance -> " + FontClass.toString());
    var linkedFont: Font = new FontClass();
    trace("Font name: " + linkedFont.fontName);
    var textFormat: TextFormat = new TextFormat(linkedFont.fontName, 14);
    //... The next lines set up the text box and apply the format.  I am sure this is done correctly.
    [/PHP]
    I get the following output:
    [PHP]FontClassInstance -> [class MyriadProRegular]
    Font name: Myriad Pro[/PHP]
    which is exactly what I would expect.  Yet, my text box is still blank.  I have embedText = true on the text box, and have applied a string to the "text" property, so it's nothing silly liek that.
    Any help would be appreciated...

    You may also want to look at the various embedded font format issues. Many of the Flex 4 components use a newer embedded font fortmat, which is not the same as the one generally used in Flash. So even if ther Flash font gets registered properly, it still may not work with some of the spark components.
    You should be able to create a swf using Flex that contains fonts embedded in either format, which can then be used in the way you describe, though, since Flex 4 suports both font formats.
    Hopefully, someone else will jump in here if I got some of this wrong.
    -JM

  • Loading SWF with audio playing in it...

    I was loading a SWF file, and noticed that even if I didn't
    add it to the display via addChild() that I can hear the audio
    playing in it. Why is this? And likewise, when I do addChild(), and
    see the SWF, then later use removeChild(), and no longer see it, I
    can still hear it playing.
    I can sort of understand that even though it's not displayed
    until using addChild() that one would HEAR it, because it is loaded
    - correct? But how would I actually get rid of/delete this when I
    no longer want to see/hear it ?

    Thanks to the both of you! I'd like to see the things you do
    to "close up shop" on the loaded SWF.
    I also found something about getting access to your loaded
    SWF here:
    TextAccessing
    document class of an externally loaded swf with AS3
    That blog describes adding a generic object in the complete
    listener:
    var loaderInfo:LoaderInfo = e.target as LoaderInfo;
    var myLoadedSWF:Object = loaderInfo.content;
    You can then target myLoadedSWF and access your SWF. Seems
    pretty different than AS1 & 2, but I suppose that's how it is
    (unless there are better ways).

  • Controlling all audio from one SWF as others load into it.

    Hello,
    I have a project which consists of multiple swf files and one
    main shell (basically a backdrop for all of the loaded content).
    The only thing in the "to be loaded" swf's are text and audio as of
    now. The files are loaded into an empty movie clip on the shell via
    the tree component and through playback controls. Is there a way
    that I can control the volume of the loaded swf from the
    main/shell? I've tried using a slider to control the volume of the
    movie clip using it's instance name, but that's not really
    referencing the SWF. Also, if I do have a controller like this will
    it maintain the level that the user sets it at as the swf's load in
    sequence? ie if they change the volume to level 20 will it stay @
    level 20 when the select another movie to play? Thanks, any
    assistance is greatly appreciated!

    if you're publishing for flash player 10, you can use unloadAndStop() instead of the loader's unload() method.
    if you're not publishing for fp10, you must explicitly stop all streams before unloading.

  • AS3 Access a Loaded SWF By Name

    Hello All,
    In AS3, when an swf is loaded via the Loader class, how do I
    access the loaded swf by name? Here is my code:
    stop();
    var loader:Loader = new Loader();
    var whichMovie:String = "main.swf";
    addChild(loader);
    function wakeLoadBar():void{
    loadBar.gotoAndPlay("fadeIn");
    function loadTheMovie(theMovie:String):void{
    trace("LOADTHEMOVIE");
    loader.contentLoaderInfo.addEventListener(Event.OPEN,
    onLoaderOpen);
    loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
    onLoaderProgress);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    onLoaderComplete);
    loader.load(new URLRequest(theMovie));
    function onLoaderOpen(event:Event):void{
    trace("OPEN");
    function onLoaderProgress(event:ProgressEvent):void{
    var percent:Number = Math.floor(event.bytesLoaded /
    event.bytesTotal * 100) + 10;
    loadBar.gotoAndStop(percent);
    trace("Progress " + percent);
    function onLoaderComplete(event:ProgressEvent):void{
    trace("Progress Complete");
    wakeLoadBar();
    function loadTheMovie is called after the loader "fadesIn"
    and the movie begins to load.
    Let's say that after the movie loads, I want to change its x
    and y, how do I go about doing that?
    laodedMovieName.x = 50;
    laodedMovieName.y = 150;

    KGlad,
    LOL... You rock!
    Thanks,
    V

  • Memory leak when loading .swf in AS3?

    Hi all,
    I've got a pretty big issue here that I can't understand.
    I've got a pretty simple app that just repeatedly loads and then
    unloads an .swf called test.swf (this loaded .swf contains nothing
    but a document class and a graphic - a circle. The document class
    is blank, it just extends Sprite).
    When I set this class as the document class of a blank .swf,
    I trace the 'totalMemory' of the flash player, and load and unload
    the (very simple) clip over and over. You'd think that with garbage
    collection and all that, the memory would stay pretty
    constant...but no! It increases (and continues to for as long as
    I've run it!).
    I'm writing an application that loads and unloads many many
    .swf files, but it needs to have the smallest footprint
    possible...any ideas as to why the memory is never released?

    One idea - there is a separate stack of memory in the flash
    player where loaded classes in separate application domains exist,
    and these classes are not being garbage collected....however, there
    is a line in adobe's documentation here:
    http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Liv eDocs_Parts&file=00000327.html
    under "Usage C" :
    quote:
    Having a new application domain also allows you to unload all
    the class definitions for garbage collection, if you can ensure
    that you do not continue to have references to the child SWF.
    Given that, as far as I can see from this code, there is no
    reference to the loaded .swf maintained....it seems to me like the
    loaded data (graphical assets AND classes) should be garbage
    collected - but, while you WILL see a slight drop in memory after
    the removal of the SWF, the overall memory continues to increase
    the more you do it. Could Adobe be mistaken?

  • Acessing loaded swf movieclip sctructure on as3

    Hi, I'm using external swf files to add skins to an
    application. Currenlty,I'm loading isolated elements successfully
    by the use of the Loader class. However, now I want to load a more
    complex skin structure that will have some movieclips already
    placed on the loaded swf stage. The question is: when I load an swf
    that athe edit time, I placed some elements on stage and gave them
    instance names, how can I access this external swf movieclip
    structure? It's something like this:
    1. First, I create the external file by placing some elements
    on its stage, naming these elements instances, like "console_bar"
    and "console_button".
    2. Then, I load this swf using the Loader class (into a
    loader called "playerConsole", for example) and, whe it finishes
    loading I try to access the elements placed on stage:
    this.addChild(playerConsole);
    playerConsole.console_bar.x = 0; // won't work - how can I
    access this instance?

    This code generates an error when I try to compile:
    1119: Access of possibly undefined property console_bar
    through a reference with static type
    flash.display:DisplayObject.

  • Color external loaded swf in AS3 Help Urgent!

    Hi i have loaded swf from an external path using the following command.
    var cviewer:Loader=new Loader();
    var curlRequest:URLRequest=new URLRequest("clipArts/"+evt.target.name);
    So this is the scenario.
    Suppose say i load Movie1.swf
    I have three movie clips inside Movie1.swf called step0, step1, step2
    I need to change the color of step0, step1 and step 2 from the parent flash file which loads movie1. All the inner movie clips color may be different from each other.
    I am able to change the color of the whole movie clip by using
    var colorInfo:ColorTransform = cviewer.transform.colorTransform;
    colorInfo.color=evt.target.selectedColor;
    cviewer.transform.colorTransform=colorInfo;
    But not of individual ones. I even tried cviewer.step0.transform.colortransform and other stuff to see if it would work. But nothing worked. Help at fastest would be deeply appreciated.
    Regards and thanks in advance.

    try:
    var colorInfo:ColorTransform = MovieClip(cviewer.content).step0.transform.colorTransform;
    colorInfo.color=evt.target.selectedColor;
    MovieClip(cviewer.content).step0.transform.colorTransform=colorInfo;

  • (AS3) Controlling Loaded SWF

    I am trying to control a loaded .swf with the parent .swf. I
    do not know how to call the loaded .swf. I know how to control the
    parent with the child, but not the other way around. any
    suggestions would be great. thanks!

    call on the Loader object where the movie is being held.
    You'll need to typecast like this....
    MovieClip(Loader.contentLoaderInfo.content). My recommendation is
    to store that path to a variable
    var myLoadedMovie:MovieClip = MovieClip(
    varNameOfMyLoader.contentLoaderInfo.content);
    change out the varNameOfMyLoader with the proper variable
    name and you should be able to target the movieclip as you would
    have done in AS2.

  • AS3 array used to load and play random swfs?

    Hi, I'm trying to use an array adapted from AS2 script to load random swfs called "koan_1.swf" or "koan_2.swf" etc into a "koan_loader_mc" on the stage.  Each "koan_#.swf" has code in its last frame to both advance the "shuffle" array in the action script in the first frame of the stage and to load the next koan swf.  The code below -- almost -- works, but....?
    Frame on main stage:
    // creates function called at the end of koan_#.swfs
    function shuffle(a:Array) {
    for (var ivar = a.length-1; ivar>=0; ivar--) {
    var p = Math.floor(Math.random())(ivar+1);
    var t = a[ivar];
    a[ivar] = a[p];
    a[p] = t;
    // loads koans into koan_loader_mc
    var index:uint = 0;
    var koan_loader:Loader = new Loader();
    var koan:Array =["swfs/koans/koan_1.swf","swfs/koans/koan_2.swf", "swfs/koans/koan_3.swf", "swfs/koans/koan_4.swf", "swfs/koans/koan_5.swf", "swfs/koans/koan_6.swf", "swfs/koans/koan_7.swf", "swfs/koans/koan_8.swf", "swfs/koans/koan_9.swf", "swfs/koans/koan_10.swf", "swfs/koans/koan_11.swf", "swfs/koans/koan_12.swf"];
    koan.shuffle();
    koan_loader.load(new URLRequest(koan[index]));
    MovieClip(this).koan_loader_mc.addChild(koan_loader);
    MovieClip(this).stop();
    Code is on the last frame of the loaded koan swfs:
    MovieClip(stage).index++
    if(MovieClip(stage).index>MovieClip(stage).koan.length-1){
    MovieClip(stage).index=0;
    MovieClip(stage).koan.shuffle();
    MovieClip(stage).koan_loader.load(new URLRequest(koan[MovieClip(stage).index]));
    MovieClip(stage).koan_loader_mc.addChild(koan_loader);
    Thanks for -- any -- guidance and suggestions...at my wit's end...

    Thank you for taking the time to help, but......unfortunately it still isn't working.  When the "koan.shuffle():" segment of code on the first frame of the stage timeline, below, is commented out, everything else in the movie (except randomizing of swfs) works fine.
    This code loads swfs (but they are not randomized/shuffled):
    // loads koans into koan_loader_mc
    var index:uint = 0;
    var koan_loader:Loader = new Loader();
    var koan:Array =["swfs/koans/koan_1.swf","swfs/koans/koan_2.swf", "swfs/koans/koan_3.swf", "swfs/koans/koan_4.swf", "swfs/koans/koan_5.swf", "swfs/koans/koan_6.swf", "swfs/koans/koan_7.swf", "swfs/koans/koan_8.swf", "swfs/koans/koan_9.swf", "swfs/koans/koan_10.swf", "swfs/koans/koan_11.swf", "swfs/koans/koan_12.swf"];
    //koan.shuffle(); 
    koan_loader.load(new URLRequest(koan[index]));
    MovieClip(this).koan_loader_mc.addChild(koan_loader);
    Thanks again for your help....

  • Tween Max AS3 Not Working on Root of loaded SWF

         I have a project where I'm loading a SWF into another Shell SWF and I've run into a strange bug.  Tween Max works in the compiled clip everywhere, but on the root of the loaded SWF.  It's not erroring out, it's just not tweening anything?
    Here's the code for the loader in the Shell...
    stop();
    //Import the required assets
    import flash.display.*;
    //Stop the playhead while loading occurs
    var ldr:Loader = new Loader();
    var url:String = "12com2682-value.swf";
    var urlReq:URLRequest = new URLRequest(url);
    ldr.load(urlReq);
    //Create a listener to call the loading function as the movie loads
    ldr.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, PL_LOADING2);
    function PL_LOADING2(event:ProgressEvent):void {
    loader_txt.visible = true;
    var pcent:Number=event.bytesLoaded/event.bytesTotal*100;
    //Display the % loaded in textfield
    loader_txt.text="loading:"+int(pcent)+"%";
    //If the movie is fully loaded, kick to the next frame on the main timeline
    //You may wish to change the gotoAndStop(2) to a gotoAndPlay(2)
    if(pcent==100){
              mc_loadscene.addChild(ldr);
              loader_txt.visible = false;
    this.loaderInfo.removeEventListener (ProgressEvent.PROGRESS, PL_LOADING);
    then in the loaded SWF, I have:
    stop();
    import com.greensock.TweenMax;
    import com.greensock.plugins.*;
    TweenPlugin.activate([AutoAlphaPlugin]);
    import fl.transitions.easing.*;
    //////mc_host is a movieclip holding a video
    TweenMax.to(mc_host, 1, {scaleY:1, scaleX:1, delay: 2.5, ease:Back.easeOut });
    //////mc_sidert is another movieclip
    TweenMax.from(mc_sidert, 2, {y:"-600"});
    Anybody else running into this error? 

    you must be doing something wrong because that code works as expected for me:  http://www.kglad.com/Files/forums/test2.html and http://www.kglad.com/Files/forums/test2.fla
    p.s. please mark helpful/correct responses.

  • Embeded flv music in swf? 

    A client wants a music player that has embedded music, rather
    than streaming from a separate mp3 file. I explained the file would
    be much faster loading if we could stream it, but he said something
    about how that wouldn't work with his .net framework. He said that
    the last flash guy that he worked with was able to do this for him.
    I've already converted the audio into an flv. and I've gotten
    the song down to about 1.9 mb. which will have to do.
    Does anybody know how I would go about accomplishing this? I
    only know how to stream.

    jonnyfogel,
    >A client wants a music player that has embedded music,
    > rather than streaming from a separate mp3 file.
    Heh, the customer is always right. ;)
    > I explained the file would be much faster loading if we
    > could stream it, but he said something about how that
    > wouldn't work with his .net framework.
    That just doesn't make sense, honestly. As long as his web
    server knows
    what an MP3 is, and is allowed to serve it up when requested,
    an external
    audio file is definitely the better way to go.
    > I've already converted the audio into an flv. and I've
    gotten
    > the song down to about 1.9 mb. which will have to do.
    Not sure why the audio needs to be converted to an FLV
    first. As a
    rule, FLV is a video format (though strictly speaking, you
    could have a
    videoless video file). I would export the audio as an MP3
    file, or some
    other strictly audio format (e.g., WAV or AIFF), then import
    that into the
    Library. Right-click your audio Library asset and choose
    Properties to see
    what your various compression settings are.
    For example, even if the original file is greater than
    1.9MB, you can
    adjust the compression settings inside Flash to experiment
    until you hit the
    "sweet spot" balance between fidelity and file size. You can
    never get
    better fidelity than what the original file has, so if your
    Library asset is
    already compressed, you can only bump it down in quality.
    Food for thought.
    With your settings configured (you'll see a Test button in
    the Audio
    Properties dialog), insert a keyframe in the main timeline
    where the audio
    should start. Click inside that keyframe and use the Property
    inspector to
    select your audio asset from the Library. Using this
    approach, you have
    effectively two choices: Event sound or Stream sound. Event
    sounds load
    into memory fully before they start to play. This means the
    playhead can be
    paused (stop() action) and the audio will keep playing until
    you stop it.
    Stream means the only that *frame*'s worth of audio loads, so
    you could
    potentially need *tons* of additional frames in that timeline
    in order for
    the full audio to be heard. There are pros and cons to
    everything, and the
    pro to Stream means you can potentially start hearing the
    audio before the
    SWF fully loads. The con, as I mentioned, is that you have to
    add enough
    frames to hear the audio play out.
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • How to load swf files within another SWF and still maintain actionscript

    Hi I was wondering how to embed an swf file inside another
    swf file, If i simply import it to the stage or the library it will
    become a symbol but the actionscript interactivity is lost, another
    question is can I have an actionscript 2 file play within an
    actionscript 3 file?
    The actionscript 2 code for embedding is something like this:
    don't mind the _mc titles
    this.cargame_mc.onRelease = function (){
    loadMovie ("Crusty Rusty's.swf", empty_mc)
    empty_mc._xscale=60;
    empty_mc._yscale=55;
    empty_mc._x=210;
    empty_mc._y=140;
    Please Help its for my uni portfolio, i want to use as2, but
    if i do i would lose the 3d possibility of as3, is there any way to
    export an as3 file and then embed in as2, using a program or
    anything? Thanks!I
    I would just like to say thanks in advance because everyone
    on here is so helpful!

    you can load an as2 file into an as3 file (using the loader
    class) and the actionscript will work in both.

  • Embedded audio file won't play in Safari

    I'm trying to plan an embedded audio file in safari, but it just never loads. Similar files on the same page are marked 'Flash 9 is required to listen to audio' - I have listened to these files before without any problems.
    I have Flash 11.5 installed, have tried uninstalling/reinstalling Flash and all the fixes for when YouTube videos won't play in Safari but to no avail.
    Any suggestions?

    You will really need to upload it if you want someone to help you troubleshoot the problem.  It could be any number of reasons.
    If and when you do upload, make sure that you upload the supporting folder that is created when you create a swf on a page.

  • How to unload externally loaded swf which contains 3D Carousel?

    Hello to all
    I am learning AS3 and have been taking on various tutorials found on the net. While learning about AS3 I came across a lesson on http://tutorials.flashmymind.com/2009/05/vertical-3d-carousel-with-actionscript-3-and-xml/ titled "Vertical 3D Carousel with AS3 and XML".
    I completed the tutorial and all worked fine so I then wanted to load the swf into a existing project. The loading of the swf goes fine and when I unload my loader it is removed but only visually as in my output panel in flash CS5 I get an error as follows
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at carousel_c_fla::MainTimeline/moveCarousel()
    this error repeats over and over again slowing my swf movie.
    So does this mean my main flash movie trying to still play / find my unloaded 3D Carousel?
    If so how do I unload remove all the AS3 that is trying to run from the 3D Carousel?
    I have included the AS3 below from the tutorial page and I understand that this is what I have to remove to "break free" from the 3D Carousel swf when it is unloaded. This is where I am stuck as my knowledge of AS3 is limited - Can you guys / girls help?
    //Import TweenMax
    import com.greensock.*;
    //The path to the XML file (use your own here)
    // old var from tutorial - var xmlPath:String = "http://tutorials.flashmymind.com/XML/carousel-menu.xml";
    var xmlPath:String = "carousel-menu.xml";
    //We'll store the loaded XML to this variable
    var xml:XML;
    //Create a loader and load the XML. Call the function "xmlLoaded" when done.
    var loader = new URLLoader();
    loader.load(new URLRequest(xmlPath));
    loader.addEventListener(Event.COMPLETE, xmlLoaded);
    //This function is called when the XML file is loaded
    function xmlLoaded(e:Event):void {
         //Make sure that we are not working with a null variable
         if ((e.target as URLLoader) != null ) {
              //Create a new XML object with the loaded XML data
              xml = new XML(loader.data);
              //Call the function that creates the menu
              createMenu();
    //We need to know how many items we have on the stage
    var numberOfItems:uint = 0;
    //This array will contain all the menu items
    var menuItems:Array = new Array();
    //Set the focal length
    var focalLength:Number = 350;
    //Set the vanishing point
    var vanishingPointX:Number = stage.stageWidth / 2;
    var vanishingPointY:Number = stage.stageHeight / 2;
    //We calculate the angleSpeed in the ENTER_FRAME listener
    var angleSpeed:Number = 0;
    //Radius of the circle
    var radius:Number = 128;
    //This function creates the menu
    function createMenu():void {
         //Get the number of menu items we will have
         numberOfItems = xml.items.item.length();
         //Calculate the angle difference between the menu items (in radians)
         var angleDifference:Number = Math.PI * (360 / numberOfItems) / 180;
         //We use a counter so we know how many menu items have been created
         var count:uint = 0;
         //Loop through all the <button></button> nodes in the XML
         for each (var item:XML in xml.items.item) {
              //Create a new menu item
              var menuItem:MenuItem = new MenuItem();
              //Calculate the starting angle for the menu item
              var startingAngle:Number = angleDifference * count;
              //Set a "currentAngle" attribute for the menu item
              menuItem.currentAngle = startingAngle;
              //Position the menu item
              menuItem.xpos3D = 0;
              menuItem.ypos3D = radius * Math.sin(startingAngle);
              menuItem.zpos3D = radius * Math.cos(startingAngle);
              //Calculate the scale ratio for the menu item (the further the item -> the smaller the scale ratio)
              var scaleRatio = focalLength/(focalLength + menuItem.zpos3D);
              //Scale the menu item according to the scale ratio
              menuItem.scaleX = menuItem.scaleY = scaleRatio;
              //Position the menu item to the stage (from 3D to 2D coordinates)
              menuItem.x = vanishingPointX + menuItem.xpos3D * scaleRatio;
              menuItem.y = vanishingPointY + menuItem.ypos3D * scaleRatio;
              //Add a text to the menu item
              menuItem.menuText.text = item.label;
              //Add a "linkTo" variable for the URL
              menuItem.linkTo = item.linkTo;
              //We don't want the text field to catch mouse events
              menuItem.mouseChildren = false;
              //Assign MOUSE_OVER, MOUSE_OUT and CLICK listeners for the menu item
              menuItem.addEventListener(MouseEvent.MOUSE_OVER, mouseOverItem);
              menuItem.addEventListener(MouseEvent.MOUSE_OUT, mouseOutItem);
              menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
              //Add the menu item to the menu items array
              menuItems.push(menuItem);
              //Add the menu item to the stage
              addChild(menuItem);
              //Assign an initial alpha
              menuItem.alpha = 0.3;
              //Add some blur to the item
              TweenMax.to(menuItem,0, {blurFilter:{blurX:1, blurY:1}});
              //Update the count
              count++;
    //Add an ENTER_FRAME listener for the animation
    addEventListener(Event.ENTER_FRAME, moveCarousel);
    //This function is called in each frame
    function moveCarousel(e:Event):void {
         //Calculate the angle speed according to mouseY position
         angleSpeed = (mouseY - stage.stageHeight / 2) * 0.0002;
         //Loop through the menu items
         for (var i:uint = 0; i < menuItems.length; i++) {
              //Store the menu item to a local variable
              var menuItem:MenuItem = menuItems[i] as MenuItem;
              //Update the current angle of the item
              menuItem.currentAngle += angleSpeed;
              //Calculate a scale ratio
              var scaleRatio = focalLength/(focalLength + menuItem.zpos3D);
              //Scale the item according to the scale ratio
              menuItem.scaleX=menuItem.scaleY=scaleRatio;
              //Set new 3D coordinates
              menuItem.xpos3D=0;
              menuItem.ypos3D=radius*Math.sin(menuItem.currentAngle);
              menuItem.zpos3D=radius*Math.cos(menuItem.currentAngle);
              //Update the item's coordinates.
              menuItem.x=vanishingPointX+menuItem.xpos3D*scaleRatio;
              menuItem.y=vanishingPointY+menuItem.ypos3D*scaleRatio;
         //Call the function that sorts the items so they overlap each other correctly
         sortZ();
    //This function sorts the items so they overlap each other correctly
    function sortZ():void {
         //Sort the array so that the item which has the highest
         //z position (= furthest away) is first in the array
         menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
         //Set new child indexes for the item
         for (var i:uint = 0; i < menuItems.length; i++) {
              setChildIndex(menuItems[i], i);
    //This function is called when a mouse is over an item
    function mouseOverItem(e:Event):void {
         //Tween the item's properties
         TweenMax.to(e.target, 0.1, {alpha: 1, glowFilter:{color:0xffffff, alpha:1, blurX:60, blurY:60},blurFilter:{blurX:0, blurY:0}});
    //This function is called when a mouse is out of an item
    function mouseOutItem(e:Event):void {
         //Tween the item's properties
         TweenMax.to(e.target, 1, {alpha: 0.3, glowFilter:{color:0xffffff, alpha:1, blurX:0, blurY:0},blurFilter:{blurX:1, blurY:1}});
    //This function is called when an item is clicked
    function itemClicked(e:Event):void {
         //Navigate to the URL that's assigned to the menu item
         var urlRequest:URLRequest=new URLRequest(e.target.linkTo);
         navigateToURL(urlRequest);

    Hi Ned thanks for the reply,
    Ok so I have a button in my main movie that loads the external swf
    stop();
    var my_loader:Loader = new Loader();
    var my_btn:Button = new Button();
    var my_pb:ProgressBar = new ProgressBar();
    my_pb.source = my_loader.contentLoaderInfo;
    my_btn.addEventListener(MouseEvent.CLICK,startLoading);
    function startLoading(e:MouseEvent):void{
    my_loader.load(new URLRequest("carousel.swf"));
    addChild(my_pb);
    my_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, finishloading);
    function finishloading(e:Event):void{
    addChild(my_loader);
    my_loader.addEventListener("killMe",
    killLoadedClip);
    removeChild(my_pb);
    function killLoadedClip(e:Event):void {
    my_loader.removeEventListener("killMe",
    killLoadedClip);
    my_loader.unloadAndStop();
    removeChild(my_loader);
    Then I have a button in my loaded swf that closes the loader
    This is spread over 2 frames
    Frame1
    function closeIt(e:MouseEvent):void {
    parent.dispatchEvent(newEvent("killMe"));
    Frame 2
    back_btn.addEventListener(MouseEvent.CLICK, closeIt);
    Frame 2 also holds all the code for the carousel
    Thanks for your time and help in advance people ; )

Maybe you are looking for