Fade in or out external swf

I have been searching high and low for the answer to this all day, and I can't figure this out.  I am new to flash and trying hard to learn.
So,  the site I am working on has five buttons, and most of them call in an external swf.  The way I have it set up is the button uses this code:
about_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
MovieClip(root).gotoAndStop("ABOUT")
which points to the "ABOUT" frame on the main timeline where I have this code in a movieclip that calls in the swf.
stop();
var fl_Loader_6:Loader;
var fl_ToLoad_6:Boolean = true;
     if(fl_ToLoad_6)
          fl_Loader_6 = new Loader();
          fl_Loader_6.load(new URLRequest("about.swf"));
          addChild(fl_Loader_6);
     else
          fl_Loader_6.unload();
          removeChild(fl_Loader_6);
          fl_Loader_6 = null;
     fl_ToLoad_6 = !fl_ToLoad_6;
This all works fine, but I want the external swf file to fade in and then stop, then fade out when I click on another button. How do I do that?
I hope that I am being clear enough for someone to answer this.
Thanks

Add a Color Matte, set to white and then adjust the Duration, to suit. Add a Cross-Dissolve between that.
The Color Matte is available from the New Icon. Not sure if a White Video has been added in PrE 8, like one has with Black Video, but Color Matte will work fine.
Good luck,
Hunt

Similar Messages

  • Fade in/out with external SWFs

    Hi All.. I"m very new to AS in general..
    I'm trying to have a simple slideshow with external SWFs that outomatic and onClick..I achieved it except the abrupt white space after the unloaded clip goes away... I have this code and I'm not getting any errors - but I mut not have it connected somehow because the fade out is still not there... Can someone please please help me with this... I really appreciate any help ahead of thime...
    //Import classes for easier use
    import fl.transitions.Tween;
    import fl.transitions.TweenEvent;
    import fl.transitions.easing.*;
    //Timer
    var slideDuration:uint = 8000;  // or use whatever
    var slideTimer:Timer=new Timer(slideDuration,0);
    slideTimer.addEventListener(TimerEvent.TIMER,autoAdvanceF);
    slideTimer.start();
    var btnA:Array = [one_btn,two_btn,three_btn];
    var previousBtn:SimpleButton = one_btn // use class type of your buttons
    function autoAdvanceF(e:TimerEvent):void{
    nextButtonF(previousBtn).dispatchEvent(new MouseEvent(MouseEvent.CLICK));
    function nextButtonF(btn:SimpleButton):SimpleButton{ // use class type of your buttons
    for(var i:uint=0;i<btnA.length;i++){
    if(btnA[i]==btn){
    return btnA[(i+1)%btnA.length];
    return null;
    //Load external SWF into main
    var Xpos:Number = 0;
    var Ypos:Number = 0;
    var swf:MovieClip;
    var loader:Loader = new Loader();
    var defaultSWF:URLRequest = new URLRequest("swfs/one_btn.swf");
    var target_mc:MovieClip = new MovieClip();
    addChild(target_mc);
    var target_mc2:MovieClip = new MovieClip();
    addChild(target_mc2);
    //load swf to movieClip
    target_mc.addChild(loader);
    //variables that store current content clip and current content indes
    var activeTarget:MovieClip = new MovieClip();
    loader.load(defaultSWF);
    loader.x = Xpos;
    loader.y = Ypos;
    addChildAt(loader,0);
    //Btns universal function (whenver any button is clicked, the loader will be removed
    function btnClick(event:MouseEvent):void {
        if (target_mc.alpha > 0) {
            target_mc.alpha -=10;
        if(target_mc2.alpha < 100) {
            target_mc2.alpha +=10;
    slideTimer.reset();
    slideTimer.start();
        previousBtn = SimpleButton(event.currentTarget);
        removeChild(loader);
        var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
        var myTween:Tween = new Tween(loader, "alpha", None.easeIn, 0, 2, 1, true);
        loader.load(newSWFRequest);
        loader.x = Xpos;
        loader.y = Ypos;
        addChildAt(loader,0);
    loader.addEventListener(Event.ENTER_FRAME, onEnter);
    // Movie level enterFrame event handler that will fade down object 1 (if it's alpha ishigher than 0) and fade up object 2 (if its aslpha is less than 100)
    function onEnter(event:Event):void {
        if (target_mc.alpha > 0) {
            target_mc.alpha -= 10;
        if (target_mc2.alpha < 1 ) {
            target_mc2.alpha +=10;
        loader.removeEventListener(Event.ENTER_FRAME, onEnter);
        trace ("the movie clip is faded in");
    /// Button Listerners
    one_btn.addEventListener(MouseEvent.CLICK,btnClick);
    two_btn.addEventListener(MouseEvent.CLICK,btnClick);
    three_btn.addEventListener(MouseEvent.CLICK,btnClick);

    The Sound Factory Studio wrote:
    Can I Fade in/out several tracks with the crossfade tool? I mean without selecting them and then add value...? just like in ProTools just selecting the regions and apply the fade tool???? VIP question
    No.
    To add crossfades or fade in/outs to multiple audio regions, you must do it from the fade parameter box, either entering numerically, or by clicking and dragging on the numeric value.

  • Problem: text fade in/out in swf-file not working correctly

    Hello to all,
    this is my first post.
    I work in a printing company and we want to administrate now our website by our own and
    we have bought now Dreamweaver CS4 and Flash CS4 for Mac. My Flash skill-level is "Beginner",
    but I am OK with simple tweenings, using symbols and that.
    I have done an advertisment banner for the home, 550x290 px, background-pictures
    and headlines fading in and out, later until the end there are three subheadlines for pricing details.
    The published swf-file works absolutely fine on my Mac, and also
    embedded in the site in Safari and Opera.
    Before uploading I wanted to check in IE and Opera on a Windows-PC
    and now there is the problem:
    the first headline does not fade in, it suddenly just appears.
    The second headline fades in the place of the first, when the first one is
    fading out. So now, for a second the text is appearing above each other and
    both neither fade in nor fade out.
    The three subheadlines later start one by one, and they work fine and fade in
    and out correctly. All pictures fade in and out correctly, too.
    What could that be?
    I`ve  just installed the newest flash-player on the Windows-PC and
    the problem is still there when I open the swf-file or when I embed it in the website.
    I would be deeply grateful for any hint.
    Thanks!

    Hi!
    The difference was, the headline property was accidentally "dynamic text", the subheadlines were static.
    I missed that.
    Before changing that now in the fla-file I checked the old one on differrent company macs,
    the problem is only one a few macs, say one of ten had the problem I watched.
    I think now, that must be just bad luck or it is a player problem.
    Allow me the question please:
    should I use dynamic text or static (then I cannot embed the font, the option dispappears then
    in the Properties-panel).
    Thanks again!

  • Trouble figuring out pathname for embedded swf loading external swfs & xml

    I have a swf that loads content from an XML file. This works fine when everything is in the same directory, but I want this swf to appear in several different HTML pages, which are in several different directories and I don't want to have to put 8 different copies of my swf online just so that they load properly. The directory structure is like this:
    main_dir:
    mod_dirmod01_dirmodcontent_dirmyembeddedswf.html
    myflash_dirsub1
    sub2:
    myflash.swf
    myflash.fla (not uploaded to the server)
    xml_dir:myxml.xml
    I created "sub1" and "sub2" just so that my swf would be the same number of directories downwards as the html has to link upwards, so that when I test the source file, it works. For the HTML, it's embedded like this (using swfobject):
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="800" height="500" id="../../../myflash_dir/sub1/sub2/myflash">
              <param name="movie" value="../../../myflash_dir/sub1/sub2/myflash.swf" />
                    <!--[if !IE]>-->
                    <object type="application/x-shockwave-flash" data="../../../myflash_dir/sub1/sub2/myflash.swf" width="800" height="500">
                    <!--<![endif]-->
                    <div>
                        <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
                    </div>
                    <!--[if !IE]>-->
                    </object>
                    <!--<![endif]-->
                </object>
    And inside the Actionscript, I have a URL like this to load the XML:
    ../../../myflash_dir/sub1/sub2/xml_dir/myxml.xml
    Testing the .fla works. But the swf does not work in the HTML. myflash.swf loads, but the loading animation spins and spins, so presumably myxml.xml is not loading. Can anyone see what I'm doing wrong?

    Durrr, this is not the first time I've answered my own question. Maybe something about trying to explain it to someone else lets my brain make the critical connection.
    Anyway, yes it was everything to do with the external SWFs being loaded. My main swf actually loads an xml containing URLs from which to load all of the other SWFs and so I had to update the URLs inside of that, and that fixed the problem.
    Sorry for wasting forum space, but maybe this will help someone else out!

  • External swf troubles

    Here's the skinny. I created a VERY simple site, main page,
    one button, and a second page with samples. Each sample is an
    external .swf with a fade in and fade out for nice transitions
    between each sample.
    If I go to the samples page and click on a number the
    external .swf loads fine for each, but if I click 'home' then try
    the same process there is a failure and no external .swf's will
    load.
    Once I leave the samples page I cant go back without it
    failing.
    Im sure its something simple, but does anybody have any
    suggestions?
    Here's my code for loading the external .swf for each sample:
    stop();
    one.onRollOver = over;
    one.onRollOut = out;
    one.onRelease = goone;
    function over () {
    this.gotoAndPlay(2);
    function out () {
    this.gotoAndPlay(7);
    function goone () {
    if (_root.currMovie == undefined) {
    _root.currMovie = "sampleone";
    container.loadMovie("sampleone.swf");
    } else if (_root.currMovie != "sampleone") {
    if (container._currentframe >= container.midframe) {
    _root.currMovie = "sampleone";
    container.play();
    Thank you to anyone that can help!

    My main page has one button on it. 'photo retouching' . When
    clicked it takes you to a new frame that has 6 buttons on it, 1
    through 6. there is a blank mc in the upper left corner that is
    used as a container. when you click a button it loads the external
    swf, when you click a new button the current sample fades out, and
    a new one fades in. below there is a home button. if i click that I
    go back to the main page with the 'photo retouching' button on it.
    if i click that, regardless of what sample was the last to be
    viewed, it takes me to the samples page with a blank mc used as a
    container and 6 working buttons.
    so the jump from frame to frame is fine, but Is the last
    viewed sample supposed to stay loaded?
    (the container is only located on the single frame of my
    timeline that holds the samples page, does that matter at
    all?)

  • Clickable slide show with external SWFs

    Hi... I would really apprecaite some help with the slide show please.
    I have a slide show that loads 3 external SWFs. (The External SWFs have buttons and action script of their own as well )
    I've gotten the SWFs to load and to switch automtically as well as on the button Click (going to next SWF in array). What  I would like to do is the following:
    - Have the buttons 1,2 and 3 go to respective SWFs (and not just a next button option)
    Also, as far as transitions (just basic fade in and out) is that something I should do within the external movie Clip?
    Thank you very much I appreciate all the help. Here's my code:
    // Array of external clips to use. Variable index refers to next clip to be displayed.
    var clips:Array = ["page1.swf", "page2.swf", "page3.swf"];
    var index:int = 0;
    // Stuff to load swf files
    var thisLoader:Loader = new Loader();
    thisLoader.contentLoaderInfo.addEventListener(Event.INIT, doneLoading);
    var thisMC:MovieClip = new MovieClip();
    stage.addChild(thisMC);            // Add empty MC initially so the nextClip function can be generic
    // Removes old MC and gets the next one, waiting until when it has initialized beore adding it to the stage
    function nextClip():void {
        thisLoader.load(new URLRequest(clips[index]));
    // Tell AS that the loaded file is a movie clip and add it to the stage.
    function doneLoading(e:Event):void {
        stage.removeChild(thisMC);
        thisMC = MovieClip(thisLoader.content);
        thisLoader.unload();
        thisMC.addEventListener(Event.ENTER_FRAME, runOnce);
        stage.addChildAt(thisMC, 0);
        thisMC.gotoAndPlay(1);
    // When thisMC has finished - the next MC starts
    function runOnce(e:Event):void {
        if(thisMC.currentFrame == thisMC.totalFrames) {
            thisMC.removeEventListener(Event.EXIT_FRAME, runOnce);
            index = (index + 1)%(clips.length);
            nextClip()
    // "Next button" just calls a function that goes to the next file name (mod the number of files in the list)
    MovieClip(parent).bttn1_mc.addEventListener(MouseEvent.CLICK, playNext);
    function playNext(e:MouseEvent):void {
        nextClip();
        index = (index + 1)%(clips.length);
    Thank you!!!

    Have you ever successfully saved anything to that external drive? My first two thoughts are that the drive isn't formatted for the Mac or that you don't have rights to save to the drive.

  • FadeOut External SWF

    Hi..
    I'm working on a slide show with external SWFs. I got everything to work (almost evrything ) ...
    Whwat I'm trying to do is have a nice transition.. I have the Loading SWFs Fade in... but there's still a split second of the white space under... so I was trying to have the Unloading SWF FAde out wile Loading SWF is Fading in... or something close to that.. Can anyone please either tell me out... here's the code I'm using - Thanks a bunch ahead of time!!!:
    //Import classes for easier use
    import fl.transitions.Tween;
    import fl.transitions.TweenEvent;
    import fl.transitions.easing.*;
    import flash.display.Stage;
    //Timer
    var slideDuration:uint = 8000;  // or use whatever
    var slideTimer:Timer=new Timer(slideDuration,0);
    slideTimer.addEventListener(TimerEvent.TIMER,autoAdvanceF);
    slideTimer.start();
    var btnA:Array = [one_btn,two_btn,three_btn];
    var previousBtn:SimpleButton = one_btn // use class type of your buttons
    function autoAdvanceF(e:TimerEvent):void{
    nextButtonF(previousBtn).dispatchEvent(new MouseEvent(MouseEvent.CLICK));
    function nextButtonF(btn:SimpleButton):SimpleButton{ // use class type of your buttons
    for(var i:uint=0;i<btnA.length;i++){
    if(btnA[i]==btn){
    return btnA[(i+1)%btnA.length];
    return null;
    //Load external SWF into main
    var Xpos:Number = 0;
    var Ypos:Number = 0;
    var swf:MovieClip;
    var loader:Loader = new Loader();
    var defaultSWF:URLRequest = new URLRequest("swfs/one_btn.swf");
    loader.load(defaultSWF);
    loader.x = Xpos;
    loader.y = Ypos;
    addChildAt(loader,0);
    //Btns universal function (whenver any button is clicked, the loader will be removed
    function btnClick(event:MouseEvent):void {
    slideTimer.reset();
    slideTimer.start();
        previousBtn = SimpleButton(event.currentTarget);
        removeChild(loader);
        var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
        var myTween:Tween = new Tween(loader, "alpha", None.easeIn, 0, 2, 1, true);
        loader.load(newSWFRequest);
        loader.x = Xpos;
        loader.y = Ypos;
        addChildAt(loader,0);
    /// Button Listerners
    one_btn.addEventListener(MouseEvent.CLICK,btnClick);
    two_btn.addEventListener(MouseEvent.CLICK,btnClick);
    three_btn.addEventListener(MouseEvent.CLICK,btnClick);

    When I first test it, it doesn't give any error, and only shows the blank page. However, than I guess when the slides are switching and the timer takes affect, these are the errors that start popping up..:
    TypeError: Error #1010: A term is undefined and has no properties.
        at main_fla::MainTimeline/loadComplete()[main_fla.MainTimeline::frame1:76]
    ReferenceError: Error #1056: Cannot create property onMotionFinished on fl.transitions.Tween.
        at main_fla::MainTimeline/loadComplete()[main_fla.MainTimeline::frame1:78]
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at main_fla::MainTimeline/autoAdvanceF()[main_fla.MainTimeline::frame1:32]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()

  • What is or isn't possible on iOS?  (Not having Loader, loadBytes(), external swfs, etc)

    My basic question is:  "What are the classes which we should not use for iOS using the packager."
    I have been trying for a few days trying to get a simple Flash app to run on the iPad.  A very simple app (with sound!) with just 2 classes works fine (Performance is a whole other issue.  We will get to that).  But if I try anything else, all I get is a white/black screen on the iPad.  So it would be really nice to know what classes, functions, etc we CANNOT use for the Packager.
    I have fairly simple app (not as simple as 2 classes) which loads some art assets via URLRequest/Loader, puts them on the stage.  Fairly common standard practice in AS3.
    I've read about not able to load an external file using the Packager.  So to fix the situation of loading assets, I have looked into the [embed] tag, which seems to work.  I hope the blogger doesn't mind, but this page is an excellent source on what works and doesn't work with the [embed] tag in it's various flavors:  http://www.richardleggett.co.uk/blog/index.php/2010/03/08/flash_builder_and_flash_pro_asse t_workflows.  For example, AS3 in a swf is stripped out from an external swf using [embed].
    The best way to load an external swf file for iOS seems to be using [embed] with "application/octet-stream" and load the swf through ByteArray (Option #4 in the link above).  This works great on the PC.  HOWEVER, on iPad, it fails.  The [embed] tag works on the iPad with the other ways, so my guess is that loadBytes() does not work.  Is this true Adobe/Flash guys?  Can you confirm this?
    My initial question is "why is this not allowed on iOS?".  If it is because of the fact that it uses a Loader, can it be changed so it's not using a Loader to construct a MovieClip?  I have a ByteArray with the raw swf/MovieClip data.  Why can't I construct a MovieClip from it without going through Loader?
    This loadBytes() failure seems to be the only thing preventing me from using the normal pipeline of Flash development in loading external assets.  If there are other ways people have found, please share!
    Now on to performance.  Adobe, can you post some examples/samples of code which runs at decent performance?  Like a "tech demo" of what is possible using the Packager running on iPad/iPhone.  That would be extremely helpful for everyone.  I have done a lot of the optimizing suggestions on various sites and pages ( and by Adobe http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html), but I am not seeing the 30 fps performance that is MORE than possible on iPhone/iPad.  Displaying and moving around Bitmaps (I don't use any vector graphics) should be blazing fast.  Quake runs on iPad without any problems and that code is 10 years old.  Moore's law dictates that drawing Bitmaps using CPU should be faster than a 3D engine written 10 years ago...  I am trying out the new iOS 4.2 which is supposed to be "significantly" better, but I am still stuck on loadBytes().
    So at this point, I am blocked on loadBytes() and my performance for a simple app which draws a few Bitmaps and MovieClips is terrible.  I am hopeful some people out there have figured out some solution (there are lots of clever people out there) and I will stumble on to something.  But being forced to go native Objective-C seems to be my only option at this point.
    In summary, here are the questions I would like to ask the Adobe/Flash group for some more help/information/advise:
    - Why is Loader not allowed on iOS?  Is it a technical limitation of the hardware/os/Flash?  Will it never be supported?  What is the future of this class on iOS?
    - Why is loadBytes() not allowed on iOS?  I have the raw embedded data in memory.  I don't need to make a remote call so security should not be an issue.  Can I create a MovieClip without using Loader?
    - Why is AS3 stripped from the timeline when a Symbol is retrieved using [embed]?  Maybe this is the same reason loadBytes() fails, but if I could use [embed] and get a copy of the Symbol, that is what I need.  (There are issues with the mx.core.MovieClipLoaderAsset/Asset, but it is better than being blocked by loadBytes())
    - What are some apps you guys have written that we can use to compare PC vs iOS?  Again, a "tech demo" or sample code of what you as experts in Packager for iOS have done which runs at decent framerate (30+fps) would be of tremendous help.  If the Adobe/Flash group hasn't gotten the current Packager for iOS to handle more than 50+ 2D Bitmaps on screen running at 30+fps, that would be good to know.  Please let us know what the experts and owners of your software are capable of getting the most throughput using the Packager.  I'd hate to sound a bit fed up/angry, but I think you are wasting a lot of people's time and energy with a piece of software that, to me, seems like it was a bit early to release.  Flash can do some great things.  If it can do it on iOS, even better.  But PROVE it to us that it's possible, before having your customers run into barriers imposed on us by trial and error.
    Thanks.

    I have hardly ever seen a post here from someone at Adobe, so you may need to be patient.
    Read this article, and get its associated demo files, to see some good performing tech demos:
    http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html
    Back to your main point, loaders are working, what isn't working for you is accessing of things in the library of a successfully loaded swf, that have been set to Export for ActionScript. That means that the swf you have loaded has an ActionScript Class, to represent the library symbol. iOS Flash apps are native ARM code, and don't include the virtual machines that a browser plugin has, and so it's not able to interpret ActionScript. That may be why it would fail.
    Now, I can think of at least a couple of reasons why you might want to have external swfs with elements that you want to reuse in the main swf. One would be if you're intending to make a lot of them, like say if you wanted to have an Asteroids game and the ability to use artwork from a set of different swfs. Another reason might be if you want to skin your interface, by taking specific elements from the loaded swf and using them in the main swf. That way you could have artists preparing those swfs for you, and you just include them in your package, and load the one you want.
    There is a way to do either of those things. The second one can be done by having the item as a named symbol on the stage of the loaded swf. With a to-be-loaded swf named "inner.swf", that has a movieclip on its stage named "mc1", this script in the main swf would load that external swf and use its symbol on the main swf's stage, without having to make the inner swf's symbol use ActionScript:
    var req:URLRequest = new URLRequest("inner.swf");
    var ldr:Loader = new Loader();
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded);
    ldr.load(req);
    function loaded(e:Event) {
    var mc:MovieClip = e.target.content as MovieClip;
    var innermc:* = mc.mc1;
    innermc.x = 50;
    innermc.y = 50;
    addChild(innermc);
    For the other case, you can take the item off the stage of the loaded swf and draw it into a bitmapdata, and then make as many bitmaps from that as you like. Here's the above example, only it adds the original movieclip to the main swf stage, and also creates a bitmap that looks the same:
    var req:URLRequest = new URLRequest("inner.swf");
    var ldr:Loader = new Loader();
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded);
    ldr.load(req);
    function loaded(e:Event) {
    var mc:MovieClip = e.target.content as MovieClip;
    var innermc:* = mc.mc1;
    innermc.x = 50;
    innermc.y = 50;
    addChild(innermc);
    var bmd:BitmapData = new BitmapData(innermc.width,innermc.height);
    bmd.draw(innermc);
    var bm:Bitmap = new Bitmap(bmd);
    bm.x = 150;
    bm.y = 150;
    addChild(bm);
    So, the thing to learn is that a native ARM code application does not have an ActionScript interpreter in it, and if you need to do something that normally requires interpreting ActionScript, find another way to do it.

  • How to control timeline sound of external SWF

    Hi All,
    Basic Intro:
    I am new in Action Script and trying to create a video tutorial framwork. In this I have lots of animated SWF files in all the files I have multiple scenes as those are 5min. to 10 min. each and all the files have the relevent background and nurration voice place directly on the TIMELINE frame by frame to match lip syncing animated chreactors.
    My file structure :
    Login.swf with login box is embedded into the Index.html
    After logged in it will load another SWF which is Control panel.swf
    3. Controlpanel.swf has the controls to control the loaded external swf files i.e.: Chapter menu, Play, pause, replay, volume-bar, next and previous buttons.
    By Default Controlpanel.swf will open chapter1.swf as soon as user logged in so no one need to open 1st file.
    Here user can navigate to other chapter swf file through Chapter menu or Next and Previous buttons.
    All files are loading and playing properly, here I am trying to control the animation and Sound both at a same time with Pause, Play and Replay through relevant buttons.
    Problem:
    By pressing “Pause button” animation stops but not the sound. Sound remains playing, and if I replay the swf by “Replay button” than animation restarts but sound also restarts that overlaps already playing audio.
    Question: So could anybody help me finding out how to:
    1. Pause the sound with animation by the same click of Pause button, and
    2. Stop the sound with animation by the same click of Stop button, and
    3. On replay it should stop playing the previously running audio and restart it with the animation like fresh loaded file, it should not sound overlapping.
    Constraints:
    Here I am using the sound file on the same time line of each individual swf file which I cannot add into any single movie clip because all the chapter swf file are having multiple scenes in it.
    For my problem I have already done a lot of browsing online in various forums and didn't find the solution. So here I am sharing the complete information regarding the project and wishing to get some good solution out here but if I missed any helpful information please ask me anytime and please help me to quickly find out the solution.
    Thanks a lot to all of you in advance to help me.

    create one global sound variable
    you can write when you are pressing pause button
    globalsoundvariable.setVolume(0)
    to play
    globalsoundvariable.setVolume(100)

  • AS3: How to access and control embedded sounds in an external swf?

    I rarely use sounds in AS3/Flash. I am using Flash Pro CS6, but I can't seem to figure out how to access, control (play, stop, etc) sounds embedded in an external SWF loaded into the main SWF.
    It's easy to control them when embedded on the main swf. However, on an externally loaded SWR, I get all kinds of errors. For this app, I really need to embed them in the external SWF.
    I read several solutions, but none seem to work.
    I embed the sound an mp3 file called soundSegment1.mp3 using Flash CS6 import tool and then open the actionscript properties panel on flash to select the class name: SoundSegment1. Then I edit the class code and create a file called SoundSegment1.as and it's saved right next to my document class main.as in the same directory. The code of the SoundSegment1 class looks like this:
    package  {
        import flash.media.*;
        public class SoundSegment1 extends Sound
            public function SoundSegment1 ()
                // no code in here
            public function playSound()
                var soundSegment1:Sound = new SoundSegment1();
                var channel:SoundChannel = soundSegment1.play();
    Then, in my main.as, I have done several attempts to play this sound such as:
    var fileLocation:URLRequest = new URLRequest(SWFToLoad); loader.load(fileLocation); loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeListener); loader.contentLoaderInfo.addEventListener(Event.INIT, initListener); 
    function initListener(e:Event):void // I also placed this code on the completeListener and it didn't work {      loader.content.soundSegment1.playSound(); // doesn't work.  }
    I get:
    Line XXX 1061: Call to a possibly undefined method playSound through a reference with static type flash.display:DisplayObject.
    or, I also read that I should be able to do something like this anywhere in the Main.as file:
    var theClass:Class = Class(loader.content.getDefinitionByName("SoundSegment1")); var theSound:theClass = new theClass(); theSound.play()  //doesn't work either.
    I also tried on the completeListener:
    var TheClass:Class = e.target.applicationDomain.getDefinition("SoundSegment1") as Class; var theSound:TheClass = new TheClass();
    theSound.play()  //doesn't work either.
    I get:
    ReferenceError: Error #1065: Variable SoundSegment1 is not defined. at flash.system::ApplicationDomain/getDefinition()
    I am stuck and I really need to get this to work. I would be genuinely grateful for your help.
    Thank you in advance for any help provided. I really need to get it to work, because I can't simply embed them in the main SWF or load them individually externally one by one.
    Thanks again!

    THANK YOU!
    I think your code may be over my head though. I think you are using an anonymous function which is not something I am familiar with (but I want to learn about if it's useful).
    I also don't know where the classS came from. I see that it's a parameter sent along with the event, but I don't really see where that came from.
    Someone at: http://www.kirupa.com/forum/showthread.php?305098-Playing-a-embedded-sound-in-an-external- swf&p=2658098#post2658098
    Is showing what seems to be an easier solution, but my problem there is I can't access the source file of the "child" swf....  ayayay.....
    I am going to tinker with your solution and see if it gets me anywhere. Thanks so much for your help again.

  • How do I load an external swf at a frame after ClickToGoToAndStopAtFrame?

    Hi, I'm quite new in working with AS3.
    I am designing a site with a menupage with buttons.
    Some of these buttons are linked to a frame that contains an external swf, which is a portfolio.
    By pressing the buttons 'AQUAREL" and "OLIEVERF" you will go to another frame and the swf-portfolio shows up.
    Now the problem is: sometimes it seems to work, sometimes it doesn't.
    You can check out yourself at www.erwinvanzijl.nl
    Is there a better whay of programming these functions?
    Am I doing something wrong or is there a better way to do it?
    This is the actionscript that I put on the second frame where the swf is to show up:
    stop();
    var Xpos_2:Number = 52;
    var Ypos_2:Number = 59;
    var swf_2:MovieClip;
    var loader_2:Loader = new Loader();
    var SWF_2:URLRequest = new URLRequest("aquaportfolio.swf");
    loader.load(SWF_2);
    loader.x = Xpos;
    loader.y = Ypos;
    addChild(loader);
    btn_menu.addEventListener(MouseEvent.CLICK, unloadcontent_2);
    function unloadcontent_2(event:MouseEvent):void {
    removeChild(loader);
    gotoAndStop("menu");

    For the unloading it is a simple matter of...
    function unloadcontent_2(event:MouseEvent):void {
       loader.unload();
       removeChild(loader);
       gotoAndStop("menu");
    Follow what Dave has to say... he's far more experienced than I.  I was too hung up wondering what swf2 was all about to ntoice there were two loaders involved in the code.

  • Watching for a variable in an external swf

    Hi,
    I'm trying to load an swf game, and then repeatedly run a check to see if the game has ended by accessing one of it's variables.  Reading the forums and searching the web has gotten me this far:
    var myLoader:MovieClipLoader = new MovieClipLoader();
    myLoader.addListener(this);
    myLoader.loadClip("game.swf", 2);
    function onLoadInit(mc:MovieClip)
         trace('testing");
    _root.onEnterFrame = function() {
        trace(_level2.LOCAL);
    "testing" appears on the output window so I know it's being loaded correctly, the game is also playing correctly.  When I run the game in debug mode, it shows that the variable _level2.LOCAL exists and has a value, but the main loop just keeps kicking out "undefined."
    I appreciate any help.

    Ok I figured out that to access it I have to use: _level2._root.LOCAL.
    Now my question is if there is a better way to watch a variable than running a loop.
    Also I was wondering if it's possible to listen for a function call in the external swf.

  • Changing a variable in an external swf

    Hello!
    I am working in Flash cs3 with actionscript 3.0.
    I want to create a swf that will act as my client's control
    panel. What i'm looking for is something with a few textboxes or
    whatever that is able to change those variables in another swf
    permanently.
    Is this possible?
    if so, can you point me to something that will help me out?
    Thanks!
    John iv

    Ok I figured out that to access it I have to use: _level2._root.LOCAL.
    Now my question is if there is a better way to watch a variable than running a loop.
    Also I was wondering if it's possible to listen for a function call in the external swf.

  • External .swf runtime linkage .pngs AS3

    Flash can compress .png files like Photoshop can compress
    .jpg files better than any other tool hands down.
    I have 77 .png files that are 1.8 .megs on my c: drive after
    I imported them and setting the file compression under the "File
    > Publish Settings" to 75% for jpg and published the .swf with
    all the .png on the stage the file size is 350K that's about 20% of
    the original file size of the .pngs downloaded file by file with 77
    separate request.
    I can create linkage in the shared .swf and test the movie
    with code in the shared .swf to add the movieclip holders for each
    .png to the stage but when I load the shared .swf into the main
    .swf Flash acts like it can't create the classes based on the
    linkage I setup or that the MovieClip linkage doesn't exist.
    I tried a test to have the shared .swf with all the .pngs and
    linked movieclips to add the assets to it's own stage and it works
    fine but that means a lot of my code and logic is included in the
    shared .swf that the designers need to add .pngs to. It's
    unfortunate AS3 sucks but I'm just about done with the project if I
    knew what a battle AS3 was going to be I would have stayed with AS2
    my next projet will be AS2 no question non at all. Anyway I setup
    "class" linkage identifier for each .png with a movieclip holder
    for each image. The 20% of the size for the pngs and one request
    vs. 77 separate request makes it worth the extra effort of
    importing the images, creating a holder movieclip with linkage but
    the main .swf that loads the shared .swf with all the assets and
    linkage can't see or create the assets like the shared .swf can
    when I test it.
    We need to have the main .swf get a handle of the linked .png
    assets and place them in the main .swf to load the assets to
    different parts of the main .swf. It's cute that the shared .swf
    can add the linked assets to it's own stage but not too useful.
    Also the way we deploy we cannot roll out a new release/build to
    update the .pngs but we can upload a new .swf to the asset server
    so the .pngs need to be in a separate .swf. I can get the shared
    MovieClip to add the linked assets to it's own stage when testing
    and when loading my problem is the main .swf that loads the shared
    .swf cannot create instances of the classes that are exported for
    runtime sharing using linkage.
    If it is possible I would like to know how the heck you get a
    handle on a linked asset in an externally loaded .swf. Preferably
    without creating my own prototyped insane class consisting of mega
    libraries of external .as files. Just a way to reference MovieClips
    holding pngs that have linkage and are setup for runtime sharing.
    It really shouldn't be this hard it's a simple task in AS2. I'm not
    looking for a coding competition or some wild class to do the job I
    want a few lines of code to create an instance of a class then
    reference to the linkage/MovieClip holding the .png to addChild it
    into a target movieclip.

    I solved it I'm loading 77 embedded assets in an external
    .swf that compresses 77 .png images without loosing quality it
    works great.

  • Need help loading an external SWF

    I'm not very proficient in Flash, so any help will be greatly appreciated. I'm trying to load an external SWF with the following code:
    T1_Bttn_BloodCar.onRelease = function() {
    t1_images_mc.loadMovie("images/T1_Gallery/BloodCar_SWF/T1_BloodCar.swf");
    t1_images_mc._alpha = 0;
    It loads the SWF, but doesn't play it correctly when I test it. Here's how the loaded movie is supposed to look:
    http://www.theroboteye.com/T1_BloodCar.html
    But instead, it plays without the transitions, like this:
    http://www.theroboteye.com/TRE2009b.html
    I've been trying to figure this out for a few days and have tried adding "this._lockroot = true;" to the SWF I'm trying to load, but I can't get it to play correctly. Can anyone tell me what I'm doing wrong? Thanks in advance.

    Try using the MovieClipLoader class (loadClip method) instead of the loadMovie method.  That way you can have a listener that waits for the movie to be loaded and then pull it into play, assigning actions and properties to it after the fact.

Maybe you are looking for

  • Question marks at end of each line in messages sent with 10.4.6 mail

    Some Outlook users are finding ?s at the end of each line in my emails sent from 10.4.6. I did not have this problem in 10.3.9. The problem appears to be resolved when I choose UTF-8 message encoding. There appears to be no way to make Mail automatic

  • Should OS/FileSystem caching be write-through?

    I have a question. I use Ubuntu. Should I mount my filesystem (which holds BDB's content) with "-o sync" option? That is, should my file system cache be write-through? I have this question because, if I turn on the logging feature in Berkeley DB but

  • 6500 slide

    hi, could anyone tell me how long to charge a new battery for manual says 1 hour 30 but does not say for first time charge

  • I want to learn how to use the creative soft synth

    please somebody throw me a bone....i need to start from the BEGINING here! where can i find a beginers guide telling me everything i need to know ...step by step ....how to configure and use the creative built in SOFT SYNTH....is there a control pane

  • Form level v/s item level trigger in oracle forms

    Hello Experts,               I am new in oracle forms.I am using forms 11g with weblogic server 10.3.5 at windows 7.I am very confused between Form level and item level triggers.What is the sense of use of when-button-pressed trigger at item level &