External swf button problem

Hi,
I have an external photo gallery with a previous and next
buttons that loads into a main swf. When I test the external swf on
its own the buttons work fine. But, when I load the external swf in
the main swf the buttons work once and to make them work again you
have to move your mouse a little to make it work again. You can not
just leave your mouse over the button and just keep on clicking the
way it works when I test the swf on its own.
Is there away to make it work without moving the mouse after
each click?
Thanks in advance

Hi I am using AS3
button_3.addEventListner(MouseEvent.CLICK,fl_ClickToLoadUnloadSWF_3);
var fl_Loader_3:loader;
var fl_ToLoad_3:Boolean=true;
function fl_ClickToLoadUnloadSWF_3(event:mouseEvent):void
if(fl_ToLoad_3)
fl_Loader_3 = new Loader();
fl_loader_3.load(new URLRequest("new_products.swf"));
addChild(fl_Loader_3);
else
fl_Loader_3.unload();
removeChild(fl_Loader_3);
fl_loader_3+null;
fl_TOLoad_3 =!fl_ToLoad_3;
This is the first half of the code for one button, the code for the second button is the same, just different variable names.
thanks

Similar Messages

  • External SWF layer problem

    I can only guess if its a layer / stacking problem or not, but I have a main fla file that loads three external SWF's, all ontop of each other, three buttons for each movie, that designate that movie is the visible one playing.
    It's basically a portfolio site.  You can see the site here
    www.tvnstudios.com/loadvis.html
    Why aren't the movies playing smoothly?  The FPS rate is the same for all three of the external SWF's and for the main fla that is loading them.
    Can anyone help? 
    I'd be so grateful!
    Thanks,
    -T
    p.s.  I'm including the fla file that has the actionscript that loads the movies.  It's a small code, but maybe the error is in there somewhere...

    If you are loading all of the files and they are all playing at the same time, that could be the problem.  Invisible files still eat up their share of the processor if they are left in a playing mode.
    I am unable to determine there is any slowness, primarily due to not knowing what the first one is supposed to be doing and the others appear to be flip book implementations that work fine as long as they are only the couple of pages I can see.

  • HELP PLEASE - loading external swf scale problem

    I have a Flex 3 Actionscript Project. Basically all it does it take some flash vars, set the sound volume,  and load an external swf using a loader and add the loader as a child. The problem is I want the loaded external swf to be scaled to fill the entire stage, even if it distorts it, and that doesn't seem to be happening.
    I really need to resolve this. ANY HELP APPRECIATED.
    Marcus

    Thanks for the reply!
    Here's basically what my code looks like (note: I cut some stuff out that wasn't relevant for the sake of clarity).
    private var swfLoader:Loader = null;
    public function MySwfContainer()  
        stage.scaleMode = StageScaleMode.EXACT_FIT;
        stage.align = StageAlign.TOP_LEFT;
        var request:URLRequest = new URLRequest(swfUrl);
        swfLoader = new Loader();
        swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,SWFLoader_Complete);
        swfLoader.load(request);       
    private function SWFLoader_Complete(event:Event):void
        addChild(swfLoader);
    What I am observing is that if a swf larger than the stage area is loaded it clips it rather than scale it down and make it fit.
    Marcus

  • External swf button to move main timeline

    Hi,
    i made a main(parent) page that loads an swf which has a button(a1) which on click i need it to move the timeline of the parent
    i wrote this code to the external swf and tryed many commands such as Object(root).gotoAndStop(1);
    a1.buttonMode = true;
    a1.addEventListener (MouseEvent.MOUSE_UP,a1a);
    function a1a(event:MouseEvent):void {
    what do i need to write inside to make it work?
    Thanks in advance

    try this:
    a1.buttonMode = true;
    a1.addEventListener (MouseEvent.MOUSE_UP,a1a);
    function a1a(event:MouseEvent):void {
    trace(a1.parent.parent.parent);
    trace(a1.parent.parent);
    //  find the right timeline , maybe with more parent.parent.... and then:
    MovieClip(a1.parent.parent.parent).gotoAndtop(10);

  • External swf path problem

    Hi there,
    I've just added some external swf.'s to my site which contain
    various slideshows and galleries which now don't work at all. I
    understand that all the paths in my external swf.'s containing
    _root will assume that the main timeline is now the _root movie, so
    I wondered if there might be a quicker way of correcting all the
    paths without having to go through each one individually as there
    are literally hundreds!
    Any help would be greatly appreciated. Many thanks.

    Hey batchas07,
    Thanks for getting back to me. Erm, I'm pretty new to flash,
    (the actionscript side of it anyway), so I didn't really follow
    your first solution. I'm currently using Flash MX so would that
    still work?
    I read somewhere else to try the 'this._lockroot = true;'
    script in the first frame of my external swfs. but this doesn't
    seem to have done the trick either?
    To give you a bit more of an idea, I'm building a site which
    has five links at the bottom of the stage which each take you to a
    different container movie clip, (each with an instance name of
    'holder'), which each of the external swfs load in to. I'm using
    the (loadMovie("external.swf", "holder") ) method of getting the
    movies. All the movies load in fine, but as some of them are
    slideshows with movie clips inside them I'm guessing their paths
    will all be wrong which is why they don't work. The only way I have
    managed to make the main movie recognize the external swfs is to
    add 'holder.' after '_root.' to all the paths to buttons and movie
    clips in these external swfs, but doing this to all of them will
    take a long time.
    Really not sure why the 'this._lockroot = true' method isn't
    working out for me???
    Thanks again for the help.

  • Fully loaded and rendered external SWF printing problem.

    I have an application that loads external SWF files that I have not built and do not have the codebase for.
    I need to know when these SWFs are fully loaded and have rendered themselves on the screen.
    Even gone to the point of giving them 80 enter frame events before trying to print and they show up on the paper sporadically.
    Does anyone know if there's some standard event coming from some object internal to SWFLoader that would let me know when the SWF is "running?"

    There is no way to know in the general case.  If it had an animation of
    birds flying around on it, when would be the right time to print it?

  • External SWF currentframe : Problem

    I have a movieclip that loads and plays an external SWF into it.
    Is there anyway to know the current frame number of the external swf so that I can use it to drag the movie progress bar.
    Note: I cannot edit the external swf's. They are just simple and static movies.
    It's urgent, please help.
    Thanks

    you can determine the current frame of any timeline in the external swf.  for example, if you want to know the current frame of the main timeline and you're using as2, use:
    targetMC._currentframe;  // where targetMC is the movieclip into which your external swf was loaded.
    in as3:
    MovieClip(ldr.content).currrentFrame;  // where ldr is the loader that loaded your external swf.

  • Linking to an external swf file problem

    I have one flash presentation which contains a movie clip
    button with all three events (onRelease, onRollOut and onRollOver)
    which links to a video which is contained in another swf. The
    button appears to be temperamental with the onRelease event. It
    will work sometimes and only when the browser is opened before
    hand. If its not the browser just opens with a blank screen. Both
    swfs are in the same directory and the onRelease event.
    I have tried IE and firefox.
    Any ideas are appreciated.
    p.s The AS uses a getURL syntax

    Hi,
    I'm the author of the article you pointed out. I'm sincerely
    sorry that you found the solution code difficult to understand.
    As kglad suggests, the problem is based on how Firefox
    handles the url that Flash Player gives to it. (Although you're
    using a relative url, behind the scenes Flash Player turns it into
    an absolute url, one that starts with "file:///c|/..." or something
    like that. (Firefox chokes on the pipe "|" character, even though
    it shouldn't.) The workaround code in my article just constructs an
    absolute url for you (using a colon ":" in place of the pipe
    character, as in "file:///c:/..."). When you pass the absolute url
    to the getURL() function, Flash Player passes it along to the
    browser unmodified, so Firefox gets it with a colon and doesn't
    choke.
    I hope that helps make things clearer.
    -Paul
    H. Paul Robertson
    ActionScript Developer/Writer
    Platform Developer Documentation
    Adobe Systems, Inc.
    http://probertson.com/

  • Play external swf

    I've got some existing swf movie that i want to load into a
    another swf as external swf. my problem is that these existing swf
    doesn't have stop() at the end of the movie, it plays in a loop.
    but i want only want it play once per button release, what should i
    do.

    Ok I followed your instructions and when I play the main swf
    (I call - load_swfs) file it plays part1.swf fine but then it gets
    to the first frame of part2.swf (which is blank) and just stops and
    doesn't go any farther! Did I put something in the wrong place?
    I've written what I did and where below.
    // In my main file (load_swfs) it's just a single blank frame
    with this code in it :-
    tl=this;
    swfA=["part1.swf","part2.swf","part3.swf"];
    dep=0;
    numLoaded = 0;
    totalLoad=3;
    lo=new Object();
    lo.onLoadInit=function(target){
    numLoaded++;
    checkIfAllLoaded();
    function checkIfAllLoaded(){
    if(numLoaded==totalLoad){
    holder1.play();
    } else {
    mc=this.createEmptyMovieClip("holder"+(numLoaded+1),dep++);
    mcl.loadClip(swfA[numLoaded],mc);
    mcl=new MovieClipLoader();
    mcl.addListener(lo);
    mc=this.createEmptyMovieClip("holder"+(numLoaded+1),dep++);
    mcl.loadClip(swfA[numLoaded],mc);
    // In part1.swf in the last frame is :-
    tl.holder2.play();
    this.removeMovieClip();
    // In part2.swf frame 1 is blank with a stop(); and in the
    last frame is:-
    tl.holder3.play();
    this.removeMovieClip();
    // In part3.swf frame 1 is blank with a stop();
    Let me know where I went wrong!
    Thanks

  • Unloading a loaded external SWF with a close button on the external SWF to unload

    I have found some discussion on this topic but I am still having trouble getting it to work and was hoping to get some help here.
    Here I have a file: http://www.dril-quip.com/test/main.swf
    I have: main.swf (a menu) and I have module.swf (content)
    If you navigate to Subsea Wellhead Systems/SS-15 BigBore II and click on that I have it load an external swf which covers most of the parent.
    So far so good. My problem is unloading the loaded 'Child' swf with the button provided on the loaded 'Child' swf.
    below is the code I used to load the file but I cant, for the life of me, find a way to unload it.
    var bigboreLoader:Loader = new Loader();
    btnbb2.addEventListener(MouseEvent.MOUSE_UP, bigborecontent);
    function bigborecontent(event:MouseEvent):void{
    var bigboreRequest:URLRequest = new URLRequest("moduletemplate.swf");
    bigboreLoader.load(bigboreRequest);
    stage.addChild(bigboreLoader);
    I am certain it requires the Child to communicate with the parent somehow but I am at a loss. If I could get a bit of advice or a link to something deal with this, it would be a big help. I just need to have my links load my modules and the remove them when the close buttong is hit on the loaded swf. I promise I have done searches and I admit I have found asnwers but still they are not working. I found the code below:
    Main FLA:
    function removeF() {
    removeChild(bigboreLoader);
    var bigboreLoader:Loader = new Loader();
    btnbb2.addEventListener(MouseEvent.MOUSE_UP, bigborecontent);
    function bigborecontent(event:MouseEvent):void{
    var bigboreRequest:URLRequest = new URLRequest("moduletemplate.swf");
    bigboreLoader.load(bigboreRequest);
    stage.addChild(bigboreLoader);
    EXTERNAL FLA:
    btnClose2.addEventListener(MouseEvent.CLICK, bigborecontent);
    function bigborecontent(myevent:MouseEvent):void {
    MovieClip(parent.parent).removeF();
    I think I have a misunderstanding of the code. Thanks for any help you might be able to provide.

    This was the original code I got:
    Main FLA: (on AS layer inside DropDownButton Movie Object)
    function removeF() {
    removeChild(myLoader);
    var myLoader:Loader=new Loader ();
    page1_mc.addEventListener(MouseEvent.CLICK, page1content);
    function page1content(myevent:MouseEvent):void {
    var myURL:URLRequest=new URLRequest("page1.swf");
    myLoader.load(myURL);
    addChild(myLoader);
    EXTERNAL FLA: (on main time line of this file)
    close_mc.addEventListener(MouseEvent.CLICK, closeMC);
    function closeMC(myevent:MouseEvent):void {
    MovieClip(parent.parent).removeF();
    Main.FLA
    myLoader=bigboreLoader (my new loader)
    page1_mc=btnbb2 (the button who event will call external swf)
    page1content = bigborecontent (name given to SWF being loaded???)
    myURL=bigboreRequest (my new URLrequest for bigbore)
    page1.swf=moduletemplate.swf (actual address of what I am loading)
    External.FLA
    close_mc=button that will close external swf
    closeMC=movie clip to close?

  • AS3 Unloading external SWF piling up problem

    I have two buttons on main SWF what loads and Unload two external SWFs back and forth.
    Also one timer function is calling external Screen saver SWF and unload the existing one when no interaction found.
    I am using unloadAndStop() function to unload the external SWFs.
    But after loading and unloading external SWFs, I am facing piling up or stack overflow problem.
    Any help will be highly appreciated.
    Thanks
    import flash.net.NetConnection;
    import flash.net.NetStream;
    import flash.media.Video;
    import flash.display.MovieClip;
    import caurina.transitions.*;
    import flash.utils.Timer;
    import flash.events.*;
    var myLoader_Map_1:Loader = new Loader();
    var myLoader_Map_2:Loader = new Loader();
    var myLoader_Screen_Saver:Loader = new Loader();
    var Ss:Boolean = false;
    var Maps:Boolean = true;
    //--------------------Screen Saver---------------------------------
    ScreenSaver();
      function ScreenSaver():void{
      var url:URLRequest = new URLRequest("screensaver.swf");
      myLoader_Screen_Saver.load(url); 
      addChild(myLoader_Screen_Saver);
      setChildIndex(myLoader_Screen_Saver, 1);
      Maps = false;
      Ss = true;
      function ScreenSaver_Unload():void{
      myLoader_Screen_Saver.unloadAndStop();
    //--------------------Map Buttons---------------------------------
    function MPstart():void{
      Tweener.addTween(MC_Maps_Btns,{alpha:1, x:778.25, y:1070.65, time:1, delay:1, transition:"easeOutCubic"});
      setChildIndex(MC_Maps_Btns, 2);
      MC_Maps_Btns.Btn_Map_1.visible = true;
      MC_Maps_Btns.Btn_Map_2.visible = true;
    function MPclose():void{
      Tweener.addTween(MC_Maps_Btns,{alpha:0, x:778.25, y:1179.85, time:1, transition:"easeOutCubic"});
    //--------------------Map 1 ---------------------------------
    MC_Maps_Btns.Btn_Map_1.addEventListener(MouseEvent.CLICK,OpenMap1);
      function OpenMap1(e:MouseEvent):void{
      var url:URLRequest = new URLRequest("Map_1.swf");
      myLoader_Map_1.load(url);
      myLoader_Map_1.alpha = 1;
      addChild(myLoader_Map_1);
      setChildIndex(myLoader_Map_1, 2);
      myLoader_Map_2.unloadAndStop();
      ScreenSaver_Unload();
      Maps = true;
      Ss = false;
      MC_Maps_Btns.Btn_Map_1.visible = false;
      MC_Maps_Btns.Btn_Map_2.visible = true;
    //--------------------Map 1 ---------------------------------
    MC_Maps_Btns.Btn_Map_2.addEventListener(MouseEvent.CLICK,OpenMap2);
      function OpenMap2(e:MouseEvent):void {
      var url:URLRequest = new URLRequest("Map_2.swf");
      myLoader_Map_2.load(url);
      myLoader_Map_2.alpha = 1;
      addChild(myLoader_Map_2);
      setChildIndex(myLoader_Map_2, 2);
      myLoader_Map_1.unloadAndStop();
      ScreenSaver_Unload();
      Maps = true;
      Ss = false;
      MC_Maps_Btns.Btn_Map_2.visible = false;
      MC_Maps_Btns.Btn_Map_1.visible = true;
    //--------------------Timer ---------------------------------
    var inactiveTime:int = 10000;
    var t:Timer = new Timer(inactiveTime);
    stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown1);
    t.addEventListener(TimerEvent.TIMER, onTimer);
    t.start();
      function onMouseDown1(e:MouseEvent):void {
      t.reset();
      t.start();
      trace("Interaction detected");
      function onTimer(e:TimerEvent):void {
      handleInactivity();
      function handleInactivity():void {
      trace('You\'re inactive.');
      if (Maps == true){
      myLoader_Map_1.unloadAndStop();
      myLoader_Map_2.unloadAndStop();
      else{
      trace("No Maps");
      if (Ss == false ){
      ScreenSaver();
      MPclose();
      else{
      trace("ScreenSaver already loaded");

    This is how I applied
    import flash.net.NetConnection;
    import flash.net.NetStream;
    import flash.media.Video;
    import flash.display.MovieClip;
    import caurina.transitions.*;
    import flash.utils.Timer;
    import flash.events.*;
    var myLoader_Map_1:Loader = new Loader();
    var myLoader_Map_2:Loader = new Loader();
    var myLoader_Screen_Saver:Loader = new Loader();
    var Ss:Boolean = false;
    var Maps:Boolean = true;
    //--------------------Screen Saver---------------------------------
    function unloadAllF():void{
    if(myLoader_Screen_Saver.content){
    myLoader_Screen_Saver.unloadAndStop();
    trace("ss unloaded");
    if(myLoader_Map_1.content){
    myLoader_Map_1.unloadAndStop();
    trace("map_1 unloaded");
    if(myLoader_Map_2.content){
    myLoader_Map_2.unloadAndStop();
    trace("map_2 unloaded");
    //etc
    ScreenSaver();
      function ScreenSaver():void{
      var url_ss:URLRequest = new URLRequest("screensaver.swf");
      unloadAllF();
      myLoader_Screen_Saver.load(url_ss); 
      addChild(myLoader_Screen_Saver);
      setChildIndex(myLoader_Screen_Saver, 1);
      Maps = false;
      Ss = true;
        function ScreenSaver_Unload():void{
      myLoader_Screen_Saver.unloadAndStop();
    //--------------------Map Buttons---------------------------------
    function MPstart():void{
      Tweener.addTween(MC_Maps_Btns,{alpha:1, x:778.25, y:1070.65, time:1, delay:1, transition:"easeOutCubic"});
      setChildIndex(MC_Maps_Btns, 2);
      MC_Maps_Btns.Btn_Map_1.visible = true;
      MC_Maps_Btns.Btn_Map_2.visible = true;
    function MPclose():void{
      Tweener.addTween(MC_Maps_Btns,{alpha:0, x:778.25, y:1179.85, time:1, transition:"easeOutCubic"});
    //--------------------Map 1 ---------------------------------
    MC_Maps_Btns.Btn_Map_1.addEventListener(MouseEvent.CLICK,OpenMap1);
      function OpenMap1(e:MouseEvent):void{
      var url_map_1:URLRequest = new URLRequest("Map_1.swf");
      unloadAllF();
      myLoader_Map_1.load(url_map_1);
      myLoader_Map_1.alpha = 1;
      addChild(myLoader_Map_1);
      setChildIndex(myLoader_Map_1, 2);
      myLoader_Map_2.unloadAndStop();
      ScreenSaver_Unload();
      Maps = true;
      Ss = false;
      MC_Maps_Btns.Btn_Map_1.visible = false;
      MC_Maps_Btns.Btn_Map_2.visible = true;
    //--------------------Map 1 ---------------------------------
    MC_Maps_Btns.Btn_Map_2.addEventListener(MouseEvent.CLICK,OpenMap2);
      function OpenMap2(e:MouseEvent):void {
      var url_map_2:URLRequest = new URLRequest("Map_2.swf");
      unloadAllF();
      myLoader_Map_2.load(url_map_2);
      myLoader_Map_2.alpha = 1;
      addChild(myLoader_Map_2);
      setChildIndex(myLoader_Map_2, 2);
      myLoader_Map_1.unloadAndStop();
      ScreenSaver_Unload();
      Maps = true;
      Ss = false;
      MC_Maps_Btns.Btn_Map_2.visible = false;
      MC_Maps_Btns.Btn_Map_1.visible = true;
    //--------------------Timer ---------------------------------
    var inactiveTime:int = 10000;
    var t:Timer = new Timer(inactiveTime);
    stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown1);
    t.addEventListener(TimerEvent.TIMER, onTimer);
    t.start();
      function onMouseDown1(e:MouseEvent):void {
      t.reset();
      t.start();
      trace("Interaction detected");
      function onTimer(e:TimerEvent):void {
      handleInactivity();
      function handleInactivity():void {
      trace('You\'re inactive.');
      if (Maps == true){
      myLoader_Map_1.unloadAndStop();
      myLoader_Map_2.unloadAndStop();
      else{
      trace("No Maps");
      if (Ss == false ){
      ScreenSaver();
      MPclose();
      else{
      trace("ScreenSaver already loaded");

  • AS3 load external swf problem, please help...

    Hey guys, I am really in need of an answer here. I would tremendously grateful if someone has the answer. I'll keep it simple and right to the point:
    1. I have created "index.swf" in AS3. Has it's own "MainClass" class.
    2. I created "holder.swf" which is the main landing page. Has 2 buttons, for the viewer to load the site in fullscreen or standard.
    3. In the timeline of "holder.swf" I have created 2 frames, 1st frame containing the buttons, second frame containing the AS3 external swf loader script.
    It does not seem to want to load my "index.swf".
    I have tested a million different ways, it load other swf's just fine, AS2 and AS3, but for some strange reason it just will NOT load "index.swf".
    This is driving me crazy, I have a feeling it has something to do with a class conflict. I have tried (import MainClass;) in the first frame of "holder.swf" and no luck.
    PLEASE GUYS, LET ME KNOW IF YOU KNOW THE ANSWER!
    THANK YOU SO MUCHO.
    Michael

    Hey kglad,
    Thanks for the quick reply!
    Well here is the problem... With the exception of a few things I need to update, as well as implementing some better preloaders etc... the site is running alright...
    About a week ago I decided that I wanted to site to start with the above landing page. A simple "holder.swf" which would give the viewer something to look at before entering the site... (ideally I want to find a script that will begin loading "index.swf" while the viewer is still on "holder.swf", but I'll figure that out later).
    Anyhow, I created "holder.swf" as I have many times before, and for some reason it does not seem to want to load "index.swf" into the second frame when instructed to do so... does that make sense?
    So... ideally I would like the site to start on the above graphic, then once the button is clicked, "index.swf" opens up...
    It's driving me crazy, because my code works on other swf's I've tested it with, just not with index.swf, which leads me to believe there is something in the MainClass.as file which is causing it not to load...
    What are your thoughts?
    Oh, and many thanks again!!!
    M

  • Transition_Manager and unloading external swf problems

    Hi there
    I´m having a few problems with my project which i although it work it has some unpleasant bugs that i´m trying to solve for days.
    When i load external swf´s they show up on top of the Menu button.Maybe because the button i´m pressing is inside the same movieclip as the Menu.
    Explaining better here´s a little diagram of my site:
    con2 MC (Instance of Menu) ---> cont3 MC (Instance of subMenu) and mainButton MC (Instance of Main)
    Here´s the general code which is inside the Painel.as
    package {
        import com.greensock.TweenLite;
        import com.greensock.TweenMax;
        import com.greensock.*;
        import com.greensock.easing.*;
        import flash.display.*;
        import flash.events.*;
        import flash.display.MovieClip;
        import fl.transitions.*;
        import fl.transitions.easing.*;
        import flash.net.URLRequest;
        import flash.display.Loader;
        import flash.events.Event;
        import flash.events.ProgressEvent;
        public class Painel3 extends MovieClip
            private var inFocus:MovieClip;
            public function Painel3():void
                setupClips();
                addEventListener(Event.ENTER_FRAME, loop);
            private function setupClips():void
            con2.mainButton.addEventListener(MouseEvent.ROLL_OVER, onOver);
            con2.mainButton.addEventListener(MouseEvent.ROLL_OUT, onOut);
            con2.mainButton.addEventListener(MouseEvent.CLICK, onClick);
                var len:int = con2.cont3.numChildren;
                for(var i:int=0; i<len; i++)
                    var mc:MovieClip = MovieClip(con2.cont3.getChildAt(i));
                    mc.buttonMode = true;
                    mc.loc = [mc.x, mc.y];
                    mc.addEventListener(MouseEvent.CLICK, onClick);
                    con2.cont3.visible = false;
            private function onOver(e:MouseEvent):void
            private function onOut(e:MouseEvent):void
            private function onClick(e:MouseEvent):void
                con2.cont3.visible = true;
    TransitionManager.start(con2.cont3, {type:Wipe, direction:Transition.IN, duration:1, easing:None.easeNone, startPoint:5} );                       
            private function loop(e:Event):void
                var distx:Number = mouseX / 1400;
                var disty:Number = mouseY / 1400;
                TweenLite.to(con2, 2, {
                            rotationY:(-70 +(145*distx)),
                            rotationX:(70 -(145*disty)),
                            ease:Expo.easeOut
    And then inside the subMenu.as class for the movieclip subMenu i have the buttons that load the external swf´s:
    package  {
        import com.greensock.TweenLite;
        import com.greensock.TweenMax;
        import com.greensock.*;
        import com.greensock.easing.*;
        import flash.display.*;
        import flash.events.*;
        import flash.display.MovieClip;
        import flash.net.URLRequest;
        import flash.display.Loader;
        import flash.events.Event;
        import flash.events.ProgressEvent;
        import fl.transitions.*;
        import fl.transitions.easing.*;
        public class subMenu extends MovieClip {
            public function subMenu() {
                // constructor code
                menu1.buttonMode = true;
                menu2.buttonMode = true;
                menu3.buttonMode = true;
                menu4.buttonMode = true;
                 menu1.addEventListener(MouseEvent.CLICK,link1);
                 menu2.addEventListener(MouseEvent.CLICK,link2);
                 menu3.addEventListener(MouseEvent.CLICK,link3);
                 menu4.addEventListener(MouseEvent.CLICK,link4);
            function link1(e:MouseEvent) {
               function startLoad()
                var mLoader:Loader = new Loader();
                var mRequest:URLRequest = new URLRequest("AugmentedReality_v1.swf");
                mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
                mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
                mLoader.load(mRequest);
    function onCompleteHandler(e:Event):void {
    var swf:DisplayObject = e.target.content;
    swf.x = -400;    
    swf.y = -300;    
    addChild(swf);
    function onProgressHandler(mProgress:ProgressEvent)
           var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
           trace(percent);
    startLoad();
            function link2(e:MouseEvent) {
                function startLoad()
                var mLoader:Loader = new Loader();
                var mRequest:URLRequest = new URLRequest("Fotos.swf");
                mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
                mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
                mLoader.load(mRequest);
    function onCompleteHandler(e:Event):void {
    var swf:DisplayObject = e.target.content;
    swf.x = -400;    
    swf.y = -300;    
    addChild(swf);
    function onProgressHandler(mProgress:ProgressEvent)
           var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
           trace(percent);
    startLoad();
            function link3(e:MouseEvent) {
            function link4(e:MouseEvent){
                function startLoad()
                var mLoader:Loader = new Loader();
                var mRequest:URLRequest = new URLRequest("Texto.swf");
                mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
                mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
                mLoader.load(mRequest);
    function onCompleteHandler(e:Event):void {
    var swf:DisplayObject = e.target.content;
    swf.x = -400;    
    swf.y = -300;    
    addChild(swf);
    function onProgressHandler(mProgress:ProgressEvent)
           var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
           trace(percent);
    startLoad();
    Like i said the swf´s show up on top of the Menu and i need it to dissapear.
    Also i want to unload the swf currently in scene so that when i load another one they don´t pile on top of each other.
    Pls help. Thanks

    Oh btw, i´m having an error 1069 Property TransitionManager not found in subMenu and there is no default value
    at fl.transitions::TransitionManager$/start()
        at Painel3/onClick()
    This doesn´t happen when i uncheck the Export for actionscript in the subMenu class but i can´t do that or else the buttons wont work.

  • Play - Pause button for external .swf?

    I'm trying to create buttons so a viewer can pause and then play an externally loaded swf. My project can be accessed at the linke below. This is how I want the project to function
         -Click a room on the building (choose Accounting for this discussion)
         -Click one of the demo options (choose Ending a Period for this discussion)
         - Now that the demo plays, I want the user to be able to play and pause the demo swf.
    The demo .swfs were created in Captivate so I don't have access to their timeline. They are loaded into an empty Loader component using the MovieClipLoader Class. Can anyone post some possible solutions to this problem? Thanks!
    http://distribution.activant.com/demos/prophet21-on-demand/

    What would that look like? Right now they're loading using the following code:
    btnCashCollect_btn.onRelease = function () {
          mcLoader.loadClip("CashCollections.swf",myLoader);
          btnEndPeriod_btn.enabled = false;
          btnCashCollect_btn.enabled = false;
          btnFinancialMGMT_btn.enabled = false;
          _root.btnHome_mc._visible = false;
    So would I use something like:
    btnPause.onRelease = function() {
         myLoader.content.pause();
    Actually I just tried that and it didn't work...I need the buttons to work for multiple external swfs that will be loaded into myLoader

  • Enabling Parent button while external swf is loaded [AS3]

    Hello everyone,
    I am very new to Flash and it takes me a while to understand what code is trying to tell me
    The problem I am currently facing is as follows:
    After searching the net for hours I finally figured out, how to load an external swf into my main timeline. As far as I understand this main timeline is the "parent". Hence the loaded, external swf should be the "child" (a quiz).
    Now the child (a quiz) loads into the flash file and is played properly, but I cannot access the button on the parent anymore. Unfortunately, I really need the home button on the parent to exit the quiz and allow for new navigation within the flash document.
    I would greatly appreciate any help.
    Thank you all in advance.
    Kliph
    my AS3 Code:
    import flash.events.MouseEvent;
    function onClick611 (event:MouseEvent) :void
            gotoAndPlay("home_einf")
    home_btn.addEventListener (MouseEvent.CLICK, onClick611);
    import flash.net.URLRequest;
    import flash.display.Loader;
    import flash.events.Event;
    import flash.events.ProgressEvent;
    function startLoad()
        var mLoader:Loader = new Loader();
        var mRequest:URLRequest = new URLRequest("quiz.swf");
    mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
    mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
    mLoader.load(mRequest);
    function onCompleteHandler(loadEvent:Event)
    addChild(loadEvent.currentTarget.content);
        function onProgressHandler(mProgress:ProgressEvent)
        var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
    trace(percent);
    startLoad();
    stop();

    By simply using addChild like you have, you're placing the loaded content above everything on the display list - covering your button. There are a few ways to solve. The easiest, if it works for you, is to just make a new layer in your timeline - make it the top most layer, and place your home button in that layer.
    Then change your addChild line from:
    addChild(loadEvent.currentTarget.content);
    to:
    addChildAt(loadEvent.currentTarget.content, numChildren - 2);
    This will place the loaded content behind the button.
    Alternatively, you can set the button to export for AS and then add it after you add the loaded file. Or you can use content containers - empty sprites that you add first, and then fill with other objects, in order to control layering.

Maybe you are looking for