ActionScript 3.0 Scrollpane external linkage. SWF

I'm working on a site in flash with actionscript 3.0. I use a scrolling pane to display an external swf file that has buttons that move forward and back through the SWF. My problem is that when the naviagtion buttons you click on the Exchange page but is at the bottom of the pane scrolling. I want the verticalPostion = 0 then it starts at the top of the next page, but don't know how to do this. can someone help me?

This is the code for my scrollpane

////////
Import fl.events.ScrollEvent;

aSp.setSize (600, 350);

function scrollListener(event:ScrollEvent):void {}
trace ("horizontalScPosition:" + aSp.horizontalScrollPosition +)
", verticalScrollPosition ="+ aSp.verticalScrollPosition); "
};
aSp.addEventListener (ScrollEvent.SCROLL, scrollListener);

function completeListener(event:Event):void {}
trace (event.target.source + "has completed loading.");
};
Add the listener.
aSp.addEventListener (Event.COMPLETE, completeListener);

aSp.source = "menu7.swf";

/////////

This is the code for the buttons used in the swf file, that I insert into the scrollpane.

/////////

Stop();

function gonext(e:MouseEvent):void {}
gotoAndStop ("menu2");
}
next.addEventListener (MouseEvent.CLICK, gomenu2);

///

function gonext2(e:MouseEvent):void {}
gotoAndStop ("menu3");
}
Next2.addEventListener (MouseEvent.CLICK, gomenu3);

function goback1(e:MouseEvent):void {}
gotoAndStop ("menu1");
}
back1.addEventListener (MouseEvent.CLICK, gomenu1);

///

is it possible to set the vertical position '0' when a buttons are pressed.

This line:

aSp.addEventListener ("main swf", scrollResetListener);

must be:

aSp.addEventListener ("iwannaresetscrolling", scrollResetListener);

Also, note that the "iwannaresetscrolling" string can be anything you choose, as long as the sender and the receiver use the same value.

If you see [event type = "iwannaresetscrolling" bubbles = true cancelable = false eventPhase = 2] in the output window, you should be following the event somewhere-, but it would be a correct output

Tags: Adobe Animate

Similar Questions

  • Removal of the external loaded swf does not decrease memory

    I'm developing a desktop application using flash builder 4.7, where I am loading swf external swf main, but after his withdrawal, it remains in the process (check in the Task Manager. os: windows 7), process decreases a little, but not as much as it should be. so, whenever I insert again and remove, process increases and after multiple loading, application crash down. I'm removing it like this

    if (_loader.numChildren>0)

         _loader.removeChildren(0,_loader.numChildren-1);

    _loader.unload();

    _loader.stopAllMovieClips();

    _loader.unloadAndStop(true);

    _loader.loaderInfo.removeEventListener(Event.COMPLETE, onComplete);

    this.removeChild(_loader);

    _loader = null;

    I have added custom destroy the external inside swf method and started calling him. I was almost everything, remove (almost say because it might be something I missed, because it's huge project) but still the long process.

    That I created empty swf (new project without code and nothing in it) and tried to integrate and to see what is happening. It was just the same...

    Then I thought again Air SDK may have solved this problem, so I've updated SDK for 19.0.0.207 currently more recent, but still nothing, even if the process now increases above.

    I think that it comes to Flash gc. One of the solutions is to have one and only instance of swf external and removeChild and addChild it whenever you need. It is a bad way to do it. Process will not increase all the time, but in my case I have many SWFs to load and it will slow down my request for computers of RAM low resources it could cause the crash and it is bad to have unnecessary things running in the background process

    so any suggestions are welcome

    No need to stop the video clips and remove... use unloadAndStop() and it will all stop and unload the file... as it is not possible to call the content of charger (clips) stop after the unload method, it is already removed... So, try to use only 3 lines only to unload the file.

  • to access methods and variables to an external loaded swf

    OK, I've been at this now for 2 straight days without success. I use external SWF as a way to customize the GUI design. The main swf default is supposed to load the external SWF and manipulate variables and methods. When I have the debug, it seems to appear on the stack which load upward variables of the external swf file. but when I try to handle it on the maintimeline, such as _level0.active_comp.name_space_header = 'Hello', it is no longer as original value defined in the SWF external or worse still undefined. I shopped, in tutorials, guide assistance, search engines, and there is no indication in the right direction, only that it should work, not that it works.


    in other words, in the external compiled swf, I put a text box empty, give the name of the instance 'name_space '.
    in the main timeline of the swf by default, I perform a simple operation createEmptyMovieClip/loadmovie.
    then on the second image, I enter custom text to be put in the external clip loaded, in the form of _level0.active_comp.name_space_header = "Hello"; and that's all, nothing. I can not even access the variables on
    any point given the default timeline. HHHEEEELLP. !!! Arrrrrgh

    The Movieclip object is only part of the answer, the real answer is the FPS of the main sequence, load the external swf file. The faster you set the time, faster it ends the loading process. So ideally, you want to set the main.swf to 120 frames per second, which is the maximum and movies of time forced as an external process. All external swf which carries only action script, inline must also be set to 120 images per second. You can create a custom Init() function to run only when the byte loading criteria has been made. This prevents a hiccup in the code and have a process of interrupted line. Anyone interested in the code example, please do not hesitate to send me an e-mail to [email protected]

  • ActionScript 2 Array for external SWF

    Hey everybody.  I have a file menu that takes care of all the clips in swf I in another folder.  I did it in a table so that it calls for the clip, and then it plays in the movieclip I have in the file menu flash.  And Yes, I use Actionscript 2.0.

    My question is, how do I make a player control that will jump to the previous swf that was played.  I already have a rewind button, but it is not going backwards through the FSV played.  I'm thinking about a code that load the previous SWF played in the table when a button is clicked.  Similarly, I would do it with a next button and just move to the next swf in the row of the table to the top.  I'll just bend a bit of code that I would have for the previous swf button.  Not much there.  I don't know where to start.  It seems that I found it almost, but miss me just one key element.

    Any help would be GREATLY appreciated.  And I'll give you the person responding correctly to a brand of "right answer".  I make sure to come back and do it.  Thanks to you all!

    This isn't the code I proposed:

    var currentSwf:Number = 0;
    var swfs:Array = new Array ("EZSmartStand/SmartStand.swf", "EZSmartStand/Warnings.swf", "EZSmartStand/LCDDisplay.swf", "EZSmartStand/Operation.swf", "EZSmartStand/Harness.swf", "EZSmartStand/Transferring.swf", "EZSmartStand/800lbvid.swf", "EZSmartStand/Ambulating.swf", "EZSmartStand/Accessories.swf", "EZSmartStand/HarnessLaundering.swf", "EZSmartStand/ChargingBatteries.swf", "EZSmartStand/EmergencyLowering.swf", "EZSmartStand/EmergencyLowering2.swf");

    var listener: Object = new Object();
    var mcl:MovieClipLoader = new MovieClipLoader();
    mcl.addListener (listener);

    Function to load the film "next".  It uses the current value of currentSwf
    to access the table of sovereign wealth funds, then increments this value.  This version loops
    around at the beginning after the last of them.

    function loadNext (): Void {}
    mcl.loadClip (SWF [currentSwf], theTargetClip_mc);
    currentSwf ++;
    If (currentSwf > = swfs.length) currentSwf = 0;
    }

    When the SWF load, put in place to constantly check its current image
    against the total number of frames, and so those that match, the SWF is done playing.
    If this is the case, then load the following.

    listener.onLoadInit = {function(targ:MovieClip):Void}
    theTargetClip_mc.onEnterFrame = function (): Void {}
    If (this ._currentframe = this ._totalframes) {}
    loadNext();
    delete this.onEnterFrame;
    }
    }
    }

    loadNext();
    function loadNext (): Void {}
    If (currentSwf > = swfs.length) return;
    mcl.loadClip (sovereign wealth funds [currentSwf], theTargetClip_mc);
    currentSwf ++;
     
    }

    function loadPrevious (): Void {}

    {if(currentSwf>1)}

    currentSwf-= 2;

    loadNext();

    }

    }
    rewind_btn.onRelease = loadPrevious;

  • How to load my external Gallery.swf in Page 6. It loads the first page (HomePage_mc)?

    Hello

    The following code loads my external file "Gallery.swf" on HomePage_mc (which is Page 1). But I want to load it on Gallery_mc (which is Page-6). How can I do?

    Here is the code:

    [code] ButtonsPanel_mc. Gallery.addEventListener (MouseEvent.CLICK, GalleryClick);

    function GalleryClick(e:Event):void {}

    If (currentClip! = Gallery_mc) {}

    currentClip.visible = false;

    Gallery_mc. Visible = true;

    currentClip = Gallery_mc ;}

    var Xpos:Number = 110;

    var Ypos:Number = 180;

    var swf:MovieClip;

    var loader: Loader = new Loader();

    var defaultSWF:URLRequest = new URLRequest("swfs/Gallery.swf");

    Loader.Load (defaultSWF);

    Loader.x = Xpos;

    Loader.y = Ypos;

    addChild (loader); }

    [/ code]

    PS: There was a problem with a hug. Now it is fixed, but when I go to the homepage or any other page after clicking on the button of the Gallery, the Galley.swf, but continued to play on top of all these pages. How to fix?

    Thank you.

    To have the Gallery load on Gallery_mc, you would use...

    Gallery_mc. AddChild (Loader) instead of addChild (loader).  Which bind to this movieclip.

  • External loading swf problem

    Hello

    I think it's my last stop to find the answer to my problem

    I made a simple project with flash CS5 that contain

    main SWF that load an external swf into movie empty

    I was able to load external swf everything smoothly but

    Problem

    the external swf file has drag-and - déposer only work perfect, but when it is called stops working

    external text in swf input do not work as when he called

    I scoured the net for a week and that you can't find the answer

    Pllllllllllllllllllllllease help

    Thanks in advance

    The loaded file using _root references?  If so, you must set the _lockroot true inside this file property so that it does not seek beyond itself to the _root of the file that it loads.  If you are not familiar with it, it is documented in the help files for Flash with examples.

  • How to add listeners for the external loaded swf files?

    IAM loading external .swf file in the file main.swf.

    IAM dispatchEvent (new Event ("loaded")) of external .swf.

    How to add the listener for the event "loaded"?

    in your swf file main something like below:

    mcExt.addEventListener ("load", onCongratsClose);

    function onCongratsClose(e:Event):void {}
    Your code

    }

  • Delete with external loaded swf movieclip

    Hello

    I have 4 empty movieclips called holderMC1, 2, 3, 4 on 4 main timeline frames

    Each movieclip load in an external swf with this code:

    var swfLoader4:Loader = new Loader();

    holderMC4.addChild (swfLoader4);

    var bgURL4:URLRequest = new URLRequest ("F1_h.swf");

    swfLoader4.contentLoaderInfo.addEventListener (Event.COMPLETE, loadProdComplete4);

    swfLoader4.load (bgURL4);

    function loadProdComplete4(e:Event):void

    {

    trace ("file loaded4");

    }

    I have 4 buttons which, when clicked on, goes to 4 labels in the main timeline image corresponding with the 4 movieclips

    Very simple - works well - except SWFs unload properly, so the video in the external swf continues to play back plan when a new swf file has been loaded.

    Can someone give me an idea of the best way to solve the problem please?

    You are welcome.

    p.s. in the future, please mark helpful/correct responses.

  • Problem external loading SWF in Flash Movie

    I am trying to load an external swf (which is a slide show) in a flash animation. The swf file in the film show and apparently plays ok but there is something wrong. On the last image(3rd) in the slide show keys stop responding and when I click on the "back" button on the second slide is going to the third slide, and not the first. When I check the SWF itself it works fine, it is only in the flash movie, where everything is blurred.

    Link to the Flash animation:

    http://www.dagif.com/habanaHarlem.swf

    This is the code that I put in the flash animation:

    holder_mc.loadMovie ("http://www.dagif.com/slideplayerHabana.swf" "");

    Link to external swf: http://www.dagif.com/slideplayerHabana.swf

    This is the code for the external swf file:

    Stop();
    next_btn.onRelease = function() {}
    If (_root._currentframe == 3) {}
    gotoAndStop (1);
    }
    else {}
    nextFrame();
    }
    }
    Stop();

    previous_btn.onRelease = function() {}
    If (_root._currentframe == 1) {}
    gotoAndStop (3);
    }
    else {}
    prevFrame();
    }

    }


    num1_btn.onRelease = function() {}
    gotoAndPlay (1);
    Stop();

    }
    num2_btn.onRelease = function() {}
    gotoAndPlay (2);
    Stop();

    }
    num3_btn.onRelease = function() {}
    gotoAndPlay (3);
    Stop();

    }

    The problem is most likely the use of _root in code that show you.  Like any swf, the _root will demonstrate to the _root of the main sequence and not the loaded swf file.  Try to use this ._lockroot = true; at the beginning of the code of the imported file, replace GOLD is _root references with _parent references.

  • HTML and external loaded SWF

    I have a Flash movie where I'm loading external SWF. When I saw Flash, it works very well. When I publish to HTML (from Flash), it works fine. When I'm trying to integrate my Flash animation in a different HTML page using Dreamweaver, load external files. I made this a hundred times in the past, but I'm having this problem with a few different Flash movies - that those who are responsible for external content - ideas?

    Looks like he had a security problem between local files and files on the network. Once I downloaded everything, it seems to work very well - what a pain to have to download whenever you want to post something works properly...

  • Externally loaded SWF X & amp; Position Y

    I spent the last 2 hours looking for this forum for a solution to my problem. I read more than 20 topics and tried all... nothing works.

    My problem:

    I have a file that uses the following script to load another swf SWF:

    loadMovieNum("Base/BASE_ALL.swf",2);

    I would like to place the "BASE_ALL.swf" exactly 100pixels from the top edge of the scene. The 'BASE_ALL.swf' is w786 by h503, while my "container.swf" is by h603 w786.
    As you might guess, my problem lies in the fact that no matter what I try, I can't force the "BASE_ALL.swf" to load and reposition FLF = 100. It's very frustrating because I'm sure that the answer is simple...

    Could someone help?

    (More info: the 'BASE_ALL.swf' load externally many other SWF files that the user clicks on the menu - it is a Web site.) All these files are by h503 w786. The only file that is h603 is 'container.swf '. The 'container.swf' is biggest 100px to allow space for a company logo that will be visible when the user accesses within the site.)

    If you have been load lines.swf and nav.swf and main.swf in a BASE_ALL.swf, then by positioning BASE_ALL.swf would position the loaded SWF.

    but these sovereign wealth funds are not loading in BASE_ALL.swf. they charge in _levels. and _levels do not inherit anything from the swf that causes their existence.

    Thus, you should use preloader code to ensure your _levels exist and when they do, you can position the _levels.

    Therefore, in container.swf, you can remove all of the code except the code that loads BASE_ALL.swf. and in BASE_ALL.swf you can use:

  • ScrollPane - External links does not

    Hello

    Help! I searched for two days and could not find a solution to this problem. This is probably something simple and I'm looking for just the wrong thing.

    I am using Flash CS3, ActionScript 2.0.

    I have a ScrollPane on my main stage and I linked to the content OK, everything works, I can see it, it shows - but the links, text and button, in my video content path do not work! The clip works very well when you look at itself, but not when you view it in the main sequence, which he calls.

    I'm new kind of Flash and I just wanted to build a simple website - it's the first thing that I have not be able to solve by finding the answer through Google and the forum to search.

    any guidance would be so appreciated!
    Thank you!


    I thought about it! I dug a little further... I found the answer in a previous post and feel like a lame brain.

    It was the scrollDrag must be "false".

    MODEL!

    I hope that this message will help someone else.

  • I can control external (AS3) SWF via Javascript behaviour?

    I intend to build a web page where the external buttons using javascript as it orders < a onClick = "javascript:LoadSWF (1)... > < img... > and their code would be load an object parent SWF (embedded in the html code) to load the desired child of SWF interactive (and replace a previous child SWF) it contains, where the user can then play with him."

    However, my question is, can an embedded SWF object will receive external instructions from javascript code? If so, how?

    Yes. Use the externalinterface class.

  • How to call the function lavel root &amp; variable external loaded swf file

    I have little problem in as3.  I load 'mainmenu.swf' file "main.swf". through class loader. so now "main.swf" is children of parents 'mainmenu.swf' file how can call "main.swf" variable and function of "mainmenu.swf".

    The parent of the loaded swf file is the charger.  The main SWF is the parent of the charger.  Then to communicate with the main storyline of the loaded file can use:

    MovieClip (parent.parent) .someFunction ();

  • Acess to an external loaded swf movieclip

    I am loading a swf file into a flash application. I want to access some movieclips in outside loadd swf of my main application. How can I do this?

    large.

Maybe you are looking for

  • How can I disable power reserve?

    How can I disable power reserve?

  • iPhone 5 s showing the location bad find my iPhone

    When I'm in my school after school, my phone watch I am across the street in the apartments across the school.  I had never moved from my school, and I have no idea where these apartments are still but it locates me in these apartments when me and my

  • Mouse 6000 v2,

    IM struggling to find the best way to contact Microsoft.  That is to say; telephone, e-mail, etc.?   My mouse wireless 6000 v2 is crazy. Whenever the cursor is on a site it opens several instantly.  It worked fine for 2 years and must have something

  • Impression of a legend

    I'm looking for a legend to print it to use as a resource.  I started working on a project that is very far along, and I don't have the original author for help.  If I had a few pages of reference I can print to help with in accordance with block dia

  • Deleted my games

    Hi, I accidentally deleted my games that come with my laptop. Solitare and others. I am wanting to get them back, but don't know how, I hope someone can help. im not smart on these pc and need help thank you