Button to another swf

Hello, I have a problem. I'm trying to make a button go to a
frame of another swf but it doesn't work as I expected because in
the flash archive from wich I call the other one there's only 2
frames, and the other one has more than 2. That makes the swf I
call to display no more than 2 frames. Also some properties or
integrity of the file gets modified, like the images counter (In
the originary archive it sows 1 of 4, 2 of 4, etc.... but from the
other flash it shows 100 of 100.
please, someone help me!!!!!!

you just need javascript...
http://www.google.ro/search?q=flash+javascript+tutorial
PS: you need a client-side language, not a server-side
one

Similar Messages

  • Call a external SWF by press the button within another SWF file but the second SWF file play Externely

    Hello Guyz.
    i am working on Macromedia Flash 8 and i just want to call a external SWF when i press the button within another SWF file.......but the second SWF file play Externely............can any one knows the code.... AS2

    try this
    http://www.actionscript.org/forums/showthread.php3?s=&threadid=28123

  • Linking SWF file in another SWF file

    Hi All,
       I need to open  a SWF file by clicking a a button in another SWF file(both SWF files are in the same folder). Can I use URL button(in Xcelsius 2008) for getting this done?

    It is possible to use the URL button to open another SWF file.  The SWF file would need to be hosted with an http address.

  • Using Actionscript 3, how do I code a button in a parent file to load at a specific frame in another swf file?

    Using Actionscript 3, how do I code a button in a parent file to load another swf file at a specific frame?

    You can either place the loading code in the desired frame of the parent file, or continuously monitor the currentFrame proiperty of the parent file and do the loading when the value matches the desired frame number.

  • How can I control a button from one swf file to another swf file?

    Hi,
    I have a main.swf file. From that file I am accessing the external.swf file which is an external file.
    Now, how can I write code on my main.swf file for the button which is on my external.swf file?
    Activities.MainPanel.close_btn.addEventListener(MouseEvent.CLICK, btnClickClose);
    Activities.MainPanel.close_btn (This buttons is actually on external.swf file, but I want to write code on main.swf file to execute it on external.swf) how can I control one swf button on other swf file?
    Thanks.

    Here's some example code that you should be able to adapt to your needs.
    // create a new loader object instance...
    var loader:Loader = new Loader();
    // make the download request...
    var request:URLRequest = new URLRequest("external.swf");
    // add a complete event listener to the loader
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    // start the actual loading process...
    loader.load(request);
    // create a new empty movieClip instance, you will put the loaded movie into this movieClip once its loaded
    var externalMovie:MovieClip;
    // this function is called when the download has finished and the file is ready to use...
    function completeHandler(event:Event):void {
       // set the contents of the loaded movie to the new empty movieClip...
               externalMovie = MovieClip(event.target.content);
       // add this new movie to the display list...
       addChild(externalMovie);
    Now you can refer to the loaded movie with the instance name "externalMovie". So if, for instance, you want to address a button in the loaded movie, you could write something like this on the main timeline:
    externalMovie.addEventListener(MouseEvent.CLICK, btnClickClose);
    function btnClickClose(event:MouseEvent):void {

  • Close current swf after a button clicked to call for another swf

    daftar_isi.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_2);
    import fl.display.ProLoader;
    var fl_ProLoader_2:ProLoader;
    var fl_ToLoad_2:Boolean = true;
    function fl_ClickToLoadUnloadSWF_2(event:MouseEvent):void
      if(fl_ToLoad_2)
      fl_ProLoader_2 = new ProLoader();
      fl_ProLoader_2.load(new URLRequest("daftarisi_c.swf"));
      addChild(fl_ProLoader_2);
      else
      fl_ProLoader_2.unload();
      removeChild(fl_ProLoader_2);
      fl_ProLoader_2 = null;
      fl_ToLoad_2 = !fl_ToLoad_2;
    What script should i add to kill this current swf after i clicked on "daftar_isi" button which will play daftarisi_c.swf?
    thanks.

    Thx ned. The new swf is added above the first swf. I need to kill the first swf when i click on the "daftar_isi" button inside first swf after it call out the new swf.
    So the button have 2 function at the same time when clicked:
    1. Call out the new swf
    2. Kill the current swf itself

  • Unable to load external swf which has runtime sharing with another swf.

    Hi,
    I am getting issues on loading external swf say "importer.swf" file into another swf file say "loader.swf" for second time like
    ReferenceError: Error #1065: Variable testSymbol is not defined. VerifyError: Error #1014: Class testClass could not be found.
    at global$init()
    In the external swf "importer.swf", i am trying to import the symbol "testSymbol" from another swf file say "exporter.swf", which exports through runtime sharing option for the symbols.
    I am having some buttons in loader.swf file and on each button click i am loading different swf files into the loader.swf after unloading the previous one.
    I am able to load and unload different swf files but unable to load the importer.swf file which is sharing symbols from external swf and that too for the second time i.e., when i click the button twice.
    When trying to debug with flash debugger, all the other swf files are being unloaded before loading of another swf but the swf which is sharing symbols/classes with another swf is not getting unloaded.
    Output when i am trying to load two files example and importer files into loader.swf file on two different button clicks. On first button click example.swf is loaded. On second button click , example.swf is unloaded and importer.swf is loaded which is successful. On first button click again importer.swf is unloaded and example.swf is loaded. On second button click again, example.swf is unloaded and importer.swf is loaded, here i am getting issues shown above.
    Attemping to launch and connect to Player using URL D:\runtime issue\loader.swf
    [SWF] D:\runtime issue\ loader.swf - 8181 bytes after decompression
    [SWF] D:\runtime issue\example.swf - 441708 bytes after decompression
    [UnloadSWF] D:\runtime issue\example.swf
    [SWF] D:\runtime issue\importer.swf - 1920 bytes after decompression
    [SWF] D:\runtime issue\importer.swf - 441708 bytes after decompression
    [SWF] D:\runtime issue\ example.swf - 441708 bytes after decompression
    [UnloadSWF] D:\runtime issue\ example.swf
    [SWF] D:\runtime issue\importer.swf - 1920 bytes after decompression
    ReferenceError: Error #1065: Variable xxxxxx is not defined.
    Debug session terminated.
    Code i am using
    b1.addEventListener(MouseEvent.CLICK, b1Clicked);
    b2.addEventListener(MouseEvent.CLICK, b2Clicked);
    var ldr:Loader;
    function b2Clicked(e:MouseEvent)
        if(ldr != null)
            ldr.unloadAndStop(true);
        ldr = new Loader();
        ldr.load(new URLRequest("importer.swf"));
        addChild(ldr);
    function b1Clicked(e:MouseEvent)
        if(ldr != null)
            ldr.unloadAndStop(true);
        ldr = new Loader();
        ldr.load(new URLRequest("example.swf"));
        addChild(ldr);
    If i try to open the swf using IE, i am not getting any issues at all. But i need to open this loader.swf in a air application. Also when i use loaderContext for the loader instance i am able to get rid of this issue but i cant use it in my application.
    So, please help me in resolving this issue.
    Thanks

    I got my answer. I had to append the photo url to the 'movie' value of the javascript embed method. Like this:
    <script language="JavaScript" type="text/javascript">
       AC_FL_RunContent(
          'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
          'width', '550',
          'height', '400',
          'src', 'lesson2',
          'quality', 'high',
          'pluginspage', 'http://www.adobe.com/go/getflashplayer',
          'align', 'middle',
          'play', 'true',
          'loop', 'true',
          'scale', 'showall',
          'wmode', 'window',
          'devicefont', 'false',
          'id', 'lesson2',
          'bgcolor', '#ffffff',
          'name', 'lesson2',
          'menu', 'true',
          'allowFullScreen', 'false',
          'allowScriptAccess','always',
          'movie', 'lesson2?photo=http://www.flash-mx.com/images/image1.jpg',
          'salign', ''
          ); //end AC code
    </script>
    Thanks,
    srb.

  • How to call method in another swf file

    Hi. I am at the moment making a website in Flash 8. The
    website consists of a main file with the buttons and then
    additional files for each page. Each of the buttons uses code
    similar to this:
    content.loadMovie("home page.swf");
    where content is the movieclip I am using to load the swf
    file into. In the main file I have a search box where a user can
    type some search terms. I have written some code that will search
    through the text field(s) on the page and highlight any words that
    appear matching the search terms. The only problem is that I cannot
    get to the text fields on the other files. So what I want to be
    able to do is attach some code to the search button that will call
    a method in another swf file using the parameters that I the user
    has specified in the search box. How would I go about doing this?
    Any help is much appreciated
    JM Young

    Place functions in the external swf. Then you can call them
    through the container clip
    content.yourFunction(args);
    Realize however, you cannot call code in an external swf
    until the frames with the functions are loaded. Timing would be an
    issue if the user can beat the loading clock or if you have code
    that is executed automatically after you start the load.
    So if timing becomes an issue, use MovieClipLoader and the
    onLoadInit method.

  • Use SWF to play another SWF

    I've been looking over the net for a while and couldn't find the answer, so I figured I would try here.  I'm designing a website, where there is a swf file on the right, and a swf file on the left. I want the one on the left to be able to communicate via button responses to the one on the right. For instance, when you hover over something on the left, it should make the right one (imageviewer.swf) go to a specific frame in there. Alot of things I read online were talking about loading an external swf into another swf, that's not something I want to do. I just want to activate one swf via another swf.  Is this even possible? I would love to be able to pull it off. Can someone please help me?

    You can talk between movies using javascript as the middleman. Here's a link that provides some information on that...
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15683

  • Pass the current position value to another swf

    I have one swf loading another swf on a release of a button.
    In both swf s I have the following function.
    I would like to pass the value of the 1st swf function to the
    second.
    This way the 2nd swf can open at the position where the 1st
    left off.
    Any ideas on how to do this?
    function picture_num() {
    current_pos = p+1;
    pos_txt.text = current_pos+" / "+total;
    Thank you

    you need to use the absolute or relative path from the
    timeline that contains the 1st function to the timeline that
    contains the 2nd function.

  • Stop another SWF movie (+ sounds) from another SWF

    Hiya there
    Thank you in advance for skim reading this and thinking if
    you can help!
    I've search and seen similar problems, but not the same.
    THE PROBLEM / CHALLENGE!
    I need a selection of simple SWF movie files with audio
    attached. They're basically audio buttons, scattered through a HTML
    page. At the moment they're set up with sound to 'stream' attached
    to a specific frame - then enough frames to cover the duration of
    the sound.
    - on press of button it skips to Frame2 where the button
    status changes and the sound plays
    - if during that playing process, the button is clicked
    again, then it jumps back to Frame1 and rests
    I've played with the StopAllSounds command, but that just
    stops the sounds on the other SWFs and doesn't stop (and revert)
    the other SWFs back to their Frame1's.
    Is this something i can solve with simple Action Script /
    Behaviours... or do i need to fiddle with the Javascript in the web
    page?
    Thank you in advance for any help
    cheers
    James

    "MrIzzard" <[email protected]> wrote in
    message news:e3l5nr$bdo$[email protected]..
    > But surely if the way i'm currently playing audio is
    from being attached into
    > the frames in the timeline (at the moment if i press a
    button to switch the
    > movie back to Frame 1, where there's no audio attached,
    the sound stops) - then
    > this would work for other frames too.
    > Does that make sense?
    If your swfs are on separate places on an html page (not one
    swf loaded by another swf) then you can use localConnection to
    communicate between swfs.
    There are some MX version 6 examples on my website where one
    swf controls one or more others..
    http://members.cox.net/4my2dogs/flash/
    You can have the receiving end stop sounds or move to a
    different frame etc.
    tralfaz

  • How do you grey out/disable fields under a radio button if another radio button is selected in Adobe Acrobat XI Pro?

    How do you grey out/disable fields under a radio button if another radio button is selected in Adobe Acrobat XI Pro?
    I’m creating a form where the user has three options to make a payment.
    1. charge to my credit card
    2. charge associated costs to bank account
    3. By cheque or money order
    My Problem is, under each option, there are required fields that has to be filled out. So if the user picks the first option, charge to my credit card, they would fill out the required fields (credit card number, expiration date etc.). But when they click submit button to submit the form, it won’t let them, because there are required fields under the second option. Also, I have the radio buttons for the three options setup so that if the user holds the shift key and clicks a radio button, it unchecks it. So what I'm trying to do is this: If the user selects the radio button for option 1, the other two options are greyed out/disabled. And if the user holds down the shift key and clicks radio button for option one again, it unchecks the radio button and the other two options are available again. Is there a way to grey out or disable the two other payment options when the other one is picked. I’m assuming I will have to use javascript, but what would the coding be and which field do I write it under?
    Thanks in advance guys

    You will have to use custom JavaScript to access the various properties of the field object.
    The radio button group has a value. When no button is selected that value is "Off". When an individual button has been selected the value for the group will be the option or export value for that individual button.
    Once you have determined the button selected, then you will know the form fields that need to be made required. You use JavaScript to access those fields and change the "read only" property to false, and set the "required" property to true. For the fields associated with the other options, those fields should be reset, made read only, and have the "required" property set to false.
    Disabling (graying-out) Form Fields
    >> Also, I have the radio buttons for the three options setup so that if the user holds the shift key and clicks a radio button, it unchecks it.
    Radio button in a PDF do not work that way. Only check boxes can be unchecked by clicking on one that has been checked.
    If you plan the coding for the Mouse UP action to test for all possible options and code for each of those options you should have what you want.
    If you want actual code you need to provide a lot more details.
    It is even possible to perform some credit card and bank routing number validations with JavaScript and some check digit formulas.

  • Textbox shows xml text in working file but now when loaded into another SWF

    Hi all,
    I have downloaded an xml gallery (as2) as we needed one for an old as2 file. Now I mostly use as3 but thought as I only needed to tweak it there would be no probs. Of course, it rarely works out that way. The problem is, text loaded from the xml file is displayed with its corresponding image. This works fine in the file. When I load the SWF into another SWF however, it all works EXCEPT the text doesn't show at all?? Whoever made the gallery used 'device fonts' in the textbox, I don't know if this has anything to do with it. I tried changing the textbox to dynamic and embedding characters but still nothing.
    This seems the key line -
    _root.descmc.desc.htmlText = XMLdaten[number];
    I have also tried
    _root.descmc.desc.htmlText = XMLdaten[number].firstChild;
    This traces out the correct xml data when tested so it is finding it okay.
    Any help would be much appreciated.
    Thanks

    The problem might be in the use of the "_root"  You probably need to set _lockroot = true; in the loaded swf, otherwise the _root is that of the loading swf, not the loaded one.

  • Error when opening swf from another swf

    Hi all,
    I'll try to explain this as good as possible.... I made a maze game that works perfectly when I run it by clicking on it's own .swf file, but when I try to access it from another .swf file which is a menu for the games I created, it does not work.
    I have absolutely no idea where to look for the error, so my question is: can it be that the main.swf (which is the menu for games) could be the problem, or the problem must be in the maze.swf?
    Thanx in advance!

    no, all code is in the first frame of actions layer:
    stop();
        var rightArrow:Boolean = false;   
        var leftArrow:Boolean = false;
        var upArrow:Boolean = false;
        var downArrow:Boolean = false;
        var speed:int = 5;
        stage.addEventListener(KeyboardEvent.KEY_DOWN, stage_onKeyDown);
        stage.addEventListener(KeyboardEvent.KEY_UP, stage_onKeyUp);
        stage.addEventListener(Event.ENTER_FRAME, stage_onEnterFrame);
        function stage_onKeyDown(event:KeyboardEvent):void {
            if(event.keyCode == Keyboard.RIGHT) rightArrow = true;
            if(event.keyCode == Keyboard.LEFT) leftArrow = true;
            if(event.keyCode == Keyboard.UP) upArrow = true;
            if(event.keyCode == Keyboard.DOWN) downArrow = true;
        function stage_onKeyUp(event:KeyboardEvent):void {
            if(event.keyCode == Keyboard.RIGHT) rightArrow = false;
            if(event.keyCode == Keyboard.LEFT) leftArrow = false;
            if(event.keyCode == Keyboard.UP) upArrow = false;
            if(event.keyCode == Keyboard.DOWN) downArrow = false;
        function stage_onEnterFrame(event:Event):void {
            var rect:Rectangle = player.getBounds(this);
            var i:int = 0;
            var xBump:int = 0;
            var yBump:int = 0;
            if(rightArrow) {
                xBump = speed;
                for(i = 0; i < speed; i++) {
                    if(maze.hitTestPoint(rect.right + i, player.y, true)) {
                        xBump = i - 1;
                        break;
            if(leftArrow) {
                xBump = -speed;
                for(i = 0; i < speed; i++) {
                    if(maze.hitTestPoint(rect.left - i, player.y, true)) {
                        xBump = -i + 1;
                        break;
            if(upArrow) {
                yBump = -speed;
                for(i = 0; i < speed; i++) {
                    if(maze.hitTestPoint(player.x, rect.top - i, true)) {
                        yBump = -i + 1;
                        break;
            if(downArrow) {
                yBump = speed;
                for(i = 0; i < speed; i++) {
                    if(maze.hitTestPoint(player.x, rect.bottom + i, true)) {
                        yBump = i - 1;
                        break;
            player.x += xBump;
            player.y += yBump;
            if(rightArrow) {
                xBump = speed;
                for(i = 0; i < speed; i++) {
                    if(cilj.hitTestPoint(rect.right + i, player.y, true)) {
                        xBump = i - 1;
                        nextScene();

  • Embedding Button symbol from swf

    Hi,
    I am embedding a Button Symbol into Flex from from a swf. The Button inside the swf has an up and over state. Now I embed the symbol into an image in Flex. The image is in one of my states.
    All works fine initially  in Flex as far as the up over state. Now the  The problem is when I go back to the base state and then back to the state with the embedded swf symbol.....it initializes still in the over state, until I mouse over then mouse out and now its in the Up state.   What could be the probelm here??
    thanks for taking time to look at this!
    -Mike
    // -- SWF EMBED ---
                [Embed(source="skins/ICD9_ReferenceCodes_v2_3_blue.swf", symbol="back_btn_button")]
                [Bindable]
                public var BadApple:Class;
    // -- SWF EMBED END --
    <mx:State name="search_code">
                <mx:RemoveChild target="{vbox1}"/>
                <mx:SetProperty target="{text1}" name="text" value="Code Search:"/>
                <mx:SetProperty target="{text1}" name="x" value="130"/>
                <mx:SetProperty target="{text1}" name="y" value="136"/>
                <mx:RemoveChild target="{image1}"/>
                <mx:AddChild position="lastChild">
                    <mx:Image  id="image_BackBtn1" x="11" y="74.95" source="{BadApple}"
                              click="OnClickNewSearch(event)"
                              />
                </mx:AddChild>
                <mx:SetProperty target="{image_BackBtn1}" name="y" value="74.95"/>
            </mx:State>

    Alex,
    I'm not  following  you, why do I need a button?.....can create Mouse over and out events like this?:
    var event:MouseEvent = new MouseEvent(MouseEventMouseEvent.MOUSE_OVER.);
    myImage.dispatchEvent(event);
    var even2t:MouseEvent = new MouseEvent(MouseEventMouseEvent.MOUSE_OUT.);
    myImage.dispatchEvent(event2);
    would this work?
    BTW any idea if this is a Bug or known issue that I'm experiencing?
    -Mike

Maybe you are looking for