Loading external flash files

Hi,
On my website i have a loade.swf and then a main flsh file
containing the site. THe loader loads the main.swf in using
moviecliploader and events, to load it into a movieclip on the ame
frame.
The main.swf loads fine but i use actionscript to give my
buttons functions which seems to be ignored.
If i view the main.swf on it's own:
www.ccut-designs.co.uk/main.swf
All works fine as planned.
If i view as it's meant to work
www.ccut-designs.co.uk
The buttons don't work and other bits of actionscript fail to
work too.
Any help here would be great as im stumped
Thanks
harry

How are you setting your button events? On the main timeline
of your main movie? Can you show us your code for that?

Similar Messages

  • Using Flashvars to load external mp3 files

    I am trying to find a very good step by step tutorial on using "Flashvars" to load external mp3 files, I have been searching on google and the many I have found fall short in some way or another. From what I have been able to gather, I have tried using the code in red (commented out), which works, and modify it to use "Flashvars". The code that works, the mp3 file is hard coded, but my goal is to use "Flashvars" which I am attempting to do in the code following the code in red. I am also including the html code. Any help will be greatly appreciated.
    Thanks,
    David
    var soundReq:URLRequest = new URLRequest("mardi_gras2.mp3");
    var sound:Sound = new Sound();
    sound.load(soundReq);
    sound.addEventListener(Event.COMPLETE, onComplete);
    function onComplete(event:Event):void
        sound.play();
    var soundReq:URLRequest = new URLRequest(root.loaderInfo.parameters.audio);
    var sound:Sound = new Sound();
    sound.load(soundReq);
    sound.addEventListener(Event.COMPLETE, onComplete);
    function onComplete(event:Event):void
        sound.play();
    HTML CODE
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="mySoundvars" align="middle">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="false" />
        <param name="movie" value="mySoundvars.swf" />
       <param name="FlashVars" value="audio=mardi_gras2.mp3" />
        <param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />    <embed src="mySoundvars.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="mySoundvars" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" FlashVars="audio=mardi_gras2.mp3" />

    Ok waterlovinguy,
    I went back to my original code, and I got things to work... I think my whole issue was with the HTML CODE. So I decided to use the "SWFObject generator". I had never used it before, frankly I had never heard of it until I started my searches on "Flashvars".
    Thank you very much for all your assistance, PEACE,
    David
    Final Codes below
    var my_var:String = new String();
    my_var = root.loaderInfo.parameters.myflashvar;
    myText.text = my_var;
    var soundReq:URLRequest = new URLRequest(root.loaderInfo.parameters.audio);
    var sound:Sound = new Sound();
    var soundControl:SoundChannel = new SoundChannel;
    sound.load(soundReq);
    play_btn.addEventListener(MouseEvent.CLICK, playSound);
    stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
    function playSound(event:MouseEvent):void
        SoundMixer.stopAll();
        soundControl = sound.play();
    function stopSound(event:MouseEvent):void
        soundControl.stop();
    HTML Code
                    <!>>
                    <!<![endif]>
                        http://www.adobe.com/go/getflashplayer
                        </a>
                    <!>>
                    </object>
                    <!<![endif]>
                </object

  • Text field is not working at first time after loading the flash files

    Hi to all,
         In my Java application, I'm using a text field and a panel to load flash files. I'm using JDIC 0.9.1 to load the flash files in the panel. The flash files are created by Flash CS4.
         While running the application, I can't enter any value in the Text field, after minimize and maximize the application I can enter the values.
         This problem happens after change the jre version from 1.6 to 1.7.
         I'm getting the following exception while running the application.
    org.jdesktop.jdic.init.JdicInitException: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
    at org.jdesktop.jdic.init.JdicManager.initBrowserNati  ve(Unknown Source)
    at org.jdesktop.jdic.browser.WebBrowser.<clinit>(Unkn  own Source)
    pls give me a solution.
    Thanks in advance...:)

    Have you tried testing on a server?
    When you test in Flash, see if you get traces when you click these buttons.

  • Trouble with loading external mp3 files

    I apologize for the length of the post. I hope this is clear
    of what I am trying to explain.
    My problem deals with getting "undefined" when I press a
    button to load an external mp3 files. The following is what my XML
    childNode looks like:
    <option phonetic="Soundless, or A" name="aleph"
    cursive="alephCursive.swf" block="alephBlock.swf"
    audio="char1.mp3"/>
    Every attribute loads the way I've programmed them, except
    for the last one "audio".
    The following is what my actionscript looks like loading in
    these attributes:
    Everything is happening inside the onLoad event for my XML
    file.
    var xmlContent = this.firstChild.firstChild;
    audioContent = new Array();
    for (var i = 0;
    i<this.firstChild.firstChild.childNodes.length; i++) {
    nextEntry = xmlContent.childNodes
    audioContent = [nextEntry.attributes.phonetic,
    nextEntry.attributes.name, nextEntry.attributes.cursive,
    extEntry.attributes.block, nextEntry.attributes.audio];
    The code above simply adds each attribute to the audioContent
    array. Each element traces out correctly.
    The following code is how I am using these attributes:
    for (var i = 0; i<audioLength; i++) {
    audioContainer.attachMovie("container4", "audioItem"+i, i);
    // Create a shortcut reference to the present movie clip
    thisClip = audioContainer["audioItem"+i];
    thisClip.myTxt1.htmlText = audioContent[0];
    thisClip.myTxt2.htmlText = audioContent
    [1];
    thisClip.cursive_mc =
    loadThis(assetPath+audioContent[2], thisClip.cursive_mc);
    thisClip.block_mc = loadThis(assetPath+audioContent
    [3], thisClip.block_mc);
    thisClip.speaker_mc.attachMovie("speaker", "speaker_mc",
    this.getNextHighestDepth());
    thisClip.speaker_mc.speaker_mc.onRollOver = function() {
    this.nextFrame();
    thisClip.speaker_mc.speaker_mc.onRollOut = function() {
    this.prevFrame();
    thisClip.speaker_mc.speaker_mc.onRelease = function() {
    mySnd.loadSound(audioPath+audioContent[4],true);
    Loading the text works inside the htmlText. Using a function
    loadThis to load external swf files works corerctly and even
    attaching a linked movieclip from my library called "speaker" works
    correctly.
    The problem comes from pressing the speaker movieclip that
    the output traces "undefined" instead of the external mp3 file.
    I appreciate any help. Thanks.

    As Ned said the problem might be with the file structure on the server. Other problems may be with spelling. You computer may not be case sensitive to the names of the .swf files that you are loading, but your server might. So, on your computer when you are testing, second.swf is the same as Second.swf, or even second.SWF. But, on the server each of these variations is seen as a different file. Another problem is that when you are loading files from the same computer in testing, those files are close and so they load very quickly from your computer. When the files have to travel from the server, there will likely be a measurable period of time before the file is ready to be shown. This is particularly problematic with video that is embedded into an .swf. The whole file will need to be downloaded and uncompressed before it is available to play. If you stream the video as an external file, you can shorten the wait considerably.

  • Loading external .swf files issue...

    Hi,
    I'm working on a simple example of loading external swf files with some ActionScript.
    I've placed an instance of List Component and gave it an instance name of loadList. Using Component Inspector, I assigned data for 4 external files as below:
    Next, I've added a UILoader component (instance name - loadWindow). The code that is supposed to load the content into UILoader is this:
    loadList.addEventListener(Event.CHANGE, selectItem);
    function selectItem(e:Event):void
        loadWindow.source = e.target.selectedItem.data;
    When I run it in a FlashPlayer, it only loads the first 2 swf files....  (I checked the files and all files are fine).
    I hope to get some light on the issue so any help will be appreciated.

    Try tracing e.target.selectedItem.data to make sure it's what you expect.
    Also, have you tried using the load() method instead of the source property?

  • I can't enter any values in JTextField after loading the flash files.

    Hi to all,
    In my application I have two panels. One panel has JTextField and another panel i loaded flash files.
    The flash files are build by CS4. I'm using JDIC to load the flash files. While open the application i loaded flash file and I try to enter any input in the textfiled, but I can't. After minimize and maximize the application I can enter the values. This problem happens only after I change the jre version from 1.6 to 1.7.
    While loading flash files I'm getting the below exception.
    org.jdesktop.jdic.init.JdicInitException: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
         at org.jdesktop.jdic.init.JdicManager.initBrowserNative(Unknown Source)
         at org.jdesktop.jdic.browser.WebBrowser.<clinit>(Unknown Source)
    pls give me a solution.
    Thanks in advance...:)

    I can't enter any values in JTextField after loading the flash files., locking.

  • Can you load external jpg files

    Is there a way to load external .jpg files on the fly or do
    they have to reside in the swf file?

    Hi Persons,
    macrofireball is correct as always, but I'll just add a
    thought to this thread because I suspect "rfull" isn't actually
    asking what he/she
    appears to be asking.
    No photo can ever be displayed "by itself". That is, image
    files are always "opened" in some sort of vehicle. It might be an
    image editor, or it might be a document like a *.DOC or a *.HTM ...
    but
    something must "contain" the image.
    So you can access a photo at any time you wish by putting it
    on a web page, then linking to the web page (for instance). Is
    something like that what you really had in mind?
    Have a good 'un folks!
    .

  • Media files prevent Flash from fully loading external XML file

    Im trying to debug a flash widget we created, and it loads
    fine on the 20 odd computers we tested on EXCEPT for one computer
    where, the application doesn't load an external XML file that calls
    for 3 small mp3 files and a FLV file to load as well.
    In a debugger, we noticed that when it tried to load these
    mp3 files it was getting a Forbidden access message. The FLV just
    prevents the FLV player from showing up at all (not even the skin).
    Can anyone figure out why, that it would work over all the
    other computers and NOT the one? On that person's computer, we
    tried it in IE, Firefox, even Chrome and the application doesn't
    load. We even cleared the cache, did a hard refresh and still
    nothing.
    However, the other computers work just fine.
    ALL the computers have the latest Flash software installed.
    What could cause this problem?

    Actually what worked was removing 'xmldoc' from the php script. So $data =$GLOBALS["HTTP_RAW_POST_DATA"]; instead of $data = xmldoc($GLOBALS["HTTP_RAW_POST_DATA"]);
    Couldn't find anything about 'xmldoc'. Is it used for anything in php?
    Anyway, the loading error went away, but then I got into problems with getting the return echoed values back. The textfield stayed empty even when saving the data.txt file worked.
    I then placed the <stuff> tags between <root> tags and then flash got the sentences between the <stuff> tags back. Why does Flash need the returned xml output to be between <root> tags for it to see the content between the <stuff> tags? So why do I need to use echo("<root><stuff>Server unable to create file.</stuff></root>"); instead of cho("<stuff>Server unable to create file.</stuff>");?

  • Firefox flash plugin not loading external xml file?

    I have a Flash based website that uses an external xml file
    to load the interface and navigation. When I view the site in
    Firefox it never seems to load the xml file therefore the interface
    doesn't load.
    Any ideas?

    Hi,
    I have followed your instructions and could able to get it working for firefox. The sameway i tried with mozilla, but not working. This time, I didnt see any errors but it is not working as expected (no animations / images displayed)
    So could you please help me.
    My system config. is X86 Solaris 5.10.
    bash-3.00# pwd
    /usr/sfw/lib/mozilla/plugins
    bash-3.00# elfdump -e libflashplayer.so
    ELF Header
      ei_magic:   { 0x7f, E, L, F }
      ei_class:   ELFCLASS32          ei_data:      ELFDATA2LSB
      e_machine:  EM_386              e_version:    EV_CURRENT
      e_type:     ET_DYN
      e_flags:                     0
      e_entry:                  0x94  e_ehsize:     52  e_shstrndx:   37
      e_shoff:              0x7fb4ac  e_shentsize:  40  e_shnum:      39
      e_phoff:                  0x34  e_phentsize:  32  e_phnum:       3Thanks
    Ram.

  • Loading external swf file in a new window

    Hi,
    I've got a few .swf files with video tutorials I've created using Captivate 4.
    I wanted to link them so I've created a main screen with menu with buttons in Flash.
    I've added AS to load the external swf files but they load in the same window. How can I load these .swf files in seperate window so that you could get back to the main window after you've finished watching?
    Here's my code:
    stop();
    var myLoader:Loader = new Loader();
    button1_btn.addEventListener(MouseEvent.CLICK, movie1_1);
    function movie1_1(e:MouseEvent):void
        var myURL:URLRequest = new URLRequest("01_01_Welcome.swf");
        myLoader.load(myURL);
        addChild(myLoader);
    I'm also attaching screenshot with menu in flash

    I've deleted the line and now the code lookes like that:
    stop();
    var myLoader:Loader = new Loader();
    button1_btn.addEventListener(MouseEvent.CLICK, movie1_1);
    function movie1_1(e:MouseEvent):void
        var myURL:URLRequest = new URLRequest("01_01_Welcome.swf");
        addChild(myLoader);
    Unfortunately, it doesn't load the .swf file when you click on the button...

  • Load external FLV files?

    I would like my desktop AIR app (built in Flash CS3) to load
    and play external FLV files which are on the same computer/hard
    drive but are not packaged as part of the AIR app. Is there a way
    to do this with the sandbox restrictions AIR has? If so can you
    point me to a sample or documentation?
    Excuse me if this is an obvious subject but the information
    out there is incomplete and confusing.

    I'm still running into the following: As soon as I test the
    movie, I get the following in the area where the video should
    appear:
    status (0 seconds)
    Level: status
    Code: NetStream.Play.Start
    status (0.434 seconds)
    Level: status
    Code: NetStream.Buffer.Flush
    status (4.898 seconds)
    Level: status
    Code: NetStream.Play.Stop
    It doesn't matter if I click the button or not. The video is
    on my network.

  • Loading External SWF Files: Making Things Simple...

    Hello everyone! This is my first post and I'm learning AS3 =)
    I didn't know about this forum but now I hope to have the time to come hear a lot, to help and be helped!
    Well, I'm trying to import some external files to my main flash file with buttons. Yes, this is a newbie question, but I'm learning... I click button 1 and content 1 is loaded, click button 2 and content 2 is loaded, and so on. So, I got two ways for doing it:
    **various buttons with listeners to run the function "loadCity"
    var box:MovieClip = new MovieClip();
    addChild(box);
    box.x=20;
    box.y=20;
    function loadCity (Event:MouseEvent):void {
    var currentCity=Event.target.name;
    var swfRequest:URLRequest=new URLRequest(currentCity+".swf");
    var swfLoader:Loader = new Loader();
    swfLoader.load(swfRequest);
    box.addChild(swfLoader); }
    The problem with this first option is that the content to the box is not renew with each click but it stacks one over each other, so I can't use it =/
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    var box:MovieClip = new MovieClip();
    addChild(box);
    box.x=20;
    box.y=20;
    var cityLoader:Loader = new Loader();
    var cityURL:URLRequest=new URLRequest("montreal.swf");
    cityLoader.load(cityURL);
    box.addChild(cityLoader);
    **various buttons with listeners to run it's own functions, like "montreal.addEventListener(MouseEvent.CLICK, loadMontreal);"
    var box:MovieClip = new MovieClip();
    addChild(box);
    box.x=20;
    box.y=20;
    function loadCity (Event:MouseEvent):void {
    var currentCity=Event.target.name;
    var swfRequest:URLRequest=new URLRequest(currentCity+".swf");
    var swfLoader:Loader = new Loader();
    swfLoader.load(swfRequest);
    box.addChild(swfLoader); }
    The problem with this first option is that the content to the box is not renew with each click but it stacks one over each other, so I can't use it =/

    Thanks Andrei!
    The "while statement" did the trick! =D
    Just one little problem. This first thread was opened involuntarily and I don't know how to delete it. The other topic, above this one, is more complete and has more details in what I'm trying to do. I still want to use tweens. =/ Could you check my other topic?
    Well, thanks again Andrei and I'm leaving the finished code here, just in case anyone else needs to do the same thing. =)
    montreal.addEventListener(MouseEvent.MOUSE_UP, loadCity);
    dublin.addEventListener(MouseEvent.MOUSE_UP, loadCity);
    sydney.addEventListener(MouseEvent.MOUSE_UP, loadCity);
    var box:MovieClip = new MovieClip();
    addChild(box);
    box.x=20;
    box.y=20;
    function loadCity (event:MouseEvent):void {
        var currentCity = event.target.name;
        // remove all the children of the box
        while (box.numChildren > 0) {box.removeChildAt(0);}
        var swfRequest:URLRequest=new URLRequest(currentCity+".swf");
        var swfLoader:Loader = new Loader();
        swfLoader.load(swfRequest);
        box.addChild(swfLoader);}

  • Loading External SWF Files: Making Things Simple... Still need help here =)

    Hello everyone! First of all, sorry for my english... I'm Brazilian and english is not my first language.
    This is my first post meant to be my first post and I'm learning AS3. Didn't know about this forum but now I hope to have the time to visit it a lot to help and be helped! =)
    Well, I'm trying to import some external files to my main flash file with buttons. Yes, this is a newbie question, but I'm learning... I click button 1 and content 1 is loaded, click button 2 and content 2 is loaded, and so on. So, I got two ways for doing it:
    edit: The code below is working fine now...
    montreal.addEventListener(MouseEvent.MOUSE_UP, loadCity);
    dublin.addEventListener(MouseEvent.MOUSE_UP, loadCity);
    sydney.addEventListener(MouseEvent.MOUSE_UP, loadCity);
    var box:MovieClip = new MovieClip();
    addChild(box);
    box.x=20;
    box.y=20;
    function loadCity (event:MouseEvent):void {
        var currentCity = event.target.name;
        // remove all the children of the box
        while (box.numChildren > 0) {box.removeChildAt(0);}
        var swfRequest:URLRequest=new URLRequest(currentCity+".swf");
        var swfLoader:Loader = new Loader();
        swfLoader.load(swfRequest);
        box.addChild(swfLoader);}
    The problem with this first option is that whenever I click a button, it don't renew the content of the "box"... instead, the content loaded is stacked over the last one and I don't know how to clean it... The user Andrei did the trick with the "while statement" so the above code is working but I don't know how to use tween with it...
    So here comes the second option:
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    montreal.buttonMode=true;
    dublin.buttonMode=true;
    sydney.buttonMode=true;
    rio.buttonMode=true;
    paris.buttonMode=true;
    london.buttonMode=true;
    home.buttonMode=true;
    var box:MovieClip = new MovieClip();
    addChild(box);
    box.x=20;
    box.y=20;
    var cityLoader:Loader = new Loader();
    var cityURL:URLRequest=new URLRequest("montreal.swf"); //I use this to show a city when the site is opened
    cityLoader.load(cityURL);
    box.addChild(cityLoader);
    **Here I add the listeners to button, each one calling its own function like:
    montreal.addEventListener(MouseEvent.CLICK, loadMontreal);
    function cityTweens():void {
        var cityIn:Tween = new Tween(box, "y", Strong.easeOut, -350, 20, 1, true);}
    function loadMontreal(event:MouseEvent):void {
        var cityURL:URLRequest=new URLRequest("montreal.swf");
        cityLoader.load(cityURL);
        cityTweens();}
    function loadDublin(event:MouseEvent):void {
        var cityURL:URLRequest=new URLRequest("dublin.swf");
        cityLoader.load(cityURL);
        cityTweens();}
    function loadSydney(event:MouseEvent):void {
        var cityURL:URLRequest=new URLRequest("sydney.swf");
        cityLoader.load(cityURL);
        cityTweens();}
    function loadRio(event:MouseEvent):void {
        var cityURL:URLRequest=new URLRequest("rio.swf");
        cityLoader.load(cityURL);
        cityTweens();}
    function loadParis(event:MouseEvent):void {
        var cityURL:URLRequest=new URLRequest("paris.swf");
        cityLoader.load(cityURL);
        cityTweens();}
    function loadLondon(event:MouseEvent):void {
        var cityURL:URLRequest=new URLRequest("london.swf");
        cityLoader.load(cityURL);
        cityTweens();}
    function loadHome(event:MouseEvent):void {
        var cityURL:URLRequest=new URLRequest("home.swf");
        cityLoader.load(cityURL);
        cityTweens();}
    Well, the second option "is" working but I have some problems with the Tween... I have to wait the tween to finish before clicking another button or the tween will bug... I don't know how to disable the buttons until the tween is finished =/
    Now, I used to have one tween for each function but now I got it inside a function and just call it inside each function. Simple for you but I was like WOW when I had the idea and put it to practice! But I'm still repeating a lot of codes here with the "cityLoader.load(cityURL);" but when I try to put it inside the function "cityTweens" it will just open the Montreal City, maybe because I'm calling it as soon as the site opens...
    I'm almost sure I can make things simple, like mixing the idea of the first code (currentCity+".swf") so I don't need to call a function for each button. I just don't know how to do it...
    Could anyone help me? I'll also be VERY happy if you point me to any tip like good practices that I'm not following.
    Thanks in advance!
    Message was edited by: newToAS3

    As I said in your previous post, removing the child would not do the trick. Technically, you need to remove it after the tween is finished.
    In any case there are several issues with how you approach the whole thing. First of all, if you target your application to be on Internet - swf loading will not happen instantly - thus you, perhaps, need to consider waiting for swfs to be loaded before you doing anything with them. But if you just do it on local machine - you don't really need for them to show up. On the other hand, even with local environment it makes sense to take into account asynchronous/unpredicatable nature of external file loading.
    Also, your code can be more comact and the same functionality delegated to a single function. The code below demonstrates one of the ways. This is not the bes way though because it forces to load objects again although they were loaded already. But this is another story. I did not check code in action, of course (this is just an idea) - it is up to your to work out bugs:
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import fl.transitions.TweenEvent;
    import flash.display.DisplayObject;
    import flash.display.Loader;
    import flash.events.Event;
    montreal.buttonMode = true;
    dublin.buttonMode = true;
    sydney.buttonMode = true;
    rio.buttonMode = true;
    paris.buttonMode = true;
    london.buttonMode = true;
    home.buttonMode = true;
    var box:MovieClip = new MovieClip();
    addChild(box);
    box.x=20;
    box.y=20;
    var cityLoader:Loader = new Loader();
    // this line will allow to wait untill content is loaded
    cityLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
    var cityURL:URLRequest = new URLRequest("montreal.swf"); //I use this to show a city when the site is opened
    cityLoader.load(cityURL);
    // don't need the following line
    // box.addChild(cityLoader);
    // make it a single listener
    montreal.addEventListener(MouseEvent.CLICK, loadSWF);
    dublin.addEventListener(MouseEvent.CLICK, loadSWF);
    sydney.addEventListener(MouseEvent.CLICK, loadSWF);
    rio.addEventListener(MouseEvent.CLICK, loadSWF);
    paris.addEventListener(MouseEvent.CLICK, loadSWF);
    london.addEventListener(MouseEvent.CLICK, loadSWF);
    home.addEventListener(MouseEvent.CLICK, loadSWF);
    // the single function handles all the loading
    function loadSWF(e:MouseEvent):void {
         switch(e.currentTarget) {
              case montreal:
                  cityURL = new URLRequest("montreal.swf");
              break;
              case dublin:
                  cityURL = new URLRequest("dublin.swf");
              break;
              case sydney:
                  cityURL = new URLRequest("sydney.swf");
              break;
              case rio:
                  cityURL = new URLRequest("rio.swf");
              break;
              case paris:
                  cityURL = new URLRequest("paris.swf");
              break;
              case london:
                  cityURL = new URLRequest("london.swf");
              break;
              case home:
                  cityURL = new URLRequest("home.swf");
              break;
         cityLoader.load(cityURL);
    function onLoadComplete(e:Event):void {
         loadedContent = e.target.content;
         // assuming that previous content will be moved out -
         // place new content behind previous one
         box.addChildAt(e.target.content, 0);
         // now you can start tweening
         // if there are more than one child
         if (box.numChildren > 1) {
              cityTweens();
    function cityTweens():void {
         // tween the topmost object
          var cityIn:Tween = new Tween(box.getChildAt(box.numChildren - 1), "y", Strong.easeOut, -350, 20, 1, true);
         // wait until motion finished
         cityIn.addEventListener(TweenEvent.MOTION_FINISH, tweenFinished);
    function tweenFinished(e:TweenEvent):void {
         // make Tween instance eligible for arbage collection
         e.target.removeEventListener(TweenEvent.MOTION_FINISH, tweenFinished);
         // now you can remove tweened object from the box
         box.removeChild(e.target.obj);
         e.target.obj = null;
    Edited some code.

  • Loading external swf file

    Hi all,
    I am trying to load an external SWF file into my website.. but it is not working. Here is my code
    public var CD:Loader=new Loader();
    protected function application1_creationCompleteHandler(event:FlexEvent):void
    CD.load(new URLRequest("http://localhost/assets/slide.swf"));
    addChild(this.CD);
    CD.x=2;
    CD.y=170; 
    // TODO Auto-generated method stub
    Can anyone tell me what is going wrong..
    The url is correct and its working in my browser when i type 'http://localhost/assets/slide.swf' in the browser... So problem is with flex..

    I am pretty sure that Flash's security measures prevents the coder from loading swfs that are not local to the swf that is trying to load them.  So the swf that is trying to load another swf would have to be on the same system or same networked server.  From what I have experienced its best to reference the location of the files from the swf that is doing the loading.  I am not sure if you are still referencing your swf as "http://localhost/assets/slide.swf" but that might be a problem as well.
    so
    mainfolder
    movie.swf
    assets
    slide.swf
    so in movie.swf
    //Start: Put in desired function
    var swfLoader:Loader = new Loader();
    swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
    swfLoader.load(new URLRequest("assets/slide.swf"));
    //End
    Also add this function
    public function loadComplete(e:Event):void
         stage.addChild(e.target.content);
    This might help explain it
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html
    the first set of bullet points highlight the security options
    ps. I got this working on my end, copy and pasted the code, of course i had to recreate the file system structure and slide.swf

  • Loading external swf files in a swf - Error#1009

    I have been having trouble using a swf file within a swf file.   The external swf files all work as expected.  However when used within another swf file I get the standard TypeError #1009 for some of my swfs.   The external swf files are mainly actionscript 3 files.  A typical swf file will have an object (or objects) in the library which has an export for ActionScipt property enabled and an addEventListener(Event.ENTERFRAME, somefunction).   About four years ago when I had to do some work with AS2 I seemed to get around a similar issue with the _lockroot method but this is no longer part of AS3. I have searched various forums and note that I am not the only one with this issue but did not find any relevant solutions.   If anyone could give me any ideas on how to get around this it would be appreciated.
    Regards
    Norman

    Hi,
    I have added a download to rapidshare and its link is:
    Download link: http://rapidshare.com/files/380202712/ExtSwfs.zip
    The main file Training01.fla has been set up with links to download several swf's.   The links that do not work properly are those labelled :  Module6 and Module 8.   The first Module 6 connects to a function that is a variation of how I was trying to load external swfs using Application Domain, while Module 8 is a link to a swf that uses and external class.  Module 8 is supposed to load with rotating stars, while Module 6 loads the same file as the link called Module 1.   As soon as I use the two links Module 6 or Module 8 the whole lot ceases to work properly.  I did also follow through the examples on the Adobe site.  The examples for Module 6 and Module 8 are tutorials I have used from the Internet as part of my training from the site FlashMyMind.com but they replicate the type of work we have been doing with respect to using ActionScript3.
    Re my background, at this stage I am self-taught using tutorials on the web and whatever books I can lay my hands on here.  There is no structured training available where I live as there is insufficient demand and no books available on Flash or ActionScript at the local book stores or libraries so the books are ones I have ordered via the Internet.  The one I am currently using apart from Adobe Classroom in a Book Flash CS4 is O'Reilly's Learning ActionScript 3.0 a Beginners Guide.
    The other problem I have been trying to solve and still researching is why one loses sound in the flash player when playing flv files, if the user has selected or restarted a video (or videos) many times eg 25 to 30 times as we create video training files and serve them to the user within the flash environment using Flash Player 9 and IE6.
    Regards
    Norman

Maybe you are looking for

  • Can one mac have multiple iCloud accounts?

    Hi, we have a family Mac, and everyone uses one Apple ID for iCloud and iTunes except for me. I want to get my Pages documents to sync with my phone iPad and the family mac, but the others in my family still need to use their iCloud account too.

  • R/3 connected to two BW systems ...

    Hello, I would like to know is it possible to connect an R/3 system to two BW systems ? Please advise, Dimitry Haritonov

  • Adjustment layers effects not applying when flattening image or merging layers CS6

    So about a week ago I noticed something changed with my adjustment layers. In an image I would make a selection and start using adjustment layers to edit that selection, and then once I was finished, I would merge the adjustment layers together so th

  • Interview questions Doubts

    Hi friends, I got some interview questions please any body answer this questions,thanks for advance. What is table partition? 2. What are the options available in transfer rule and when ABAP code is recquired during the transfer rule what important v

  • Do I need a mouse?

    I am about to buy my first MacBook online from Apple?  Do I need a mouse, or is the trackpad really so good that I won't need a mouse? Thanks!