begginner with Actionscript, need a line of code for a button please

Hello

I designed an E-card and decided to add a button 'replay '. Addmittedly with much help from net and relying on my basic coding skills I managed to get the almost complete ActionScript code and the compiler is unhappy with a single line. I just spent ages trying to find the right code but time beat me tonight. Here's what I have so far:

import flash.display.MovieClip;
import flash.events.IEventDispatcher;
Stop();
replay_btn.addEventListener (MouseEvent.Click, replay_ecard);
function replay_ecard(event:MouseEvent):void {}
}
replay_btn.gotoAndPlay ();

He is not happy with the 'replay_btn' in the last line and I also need to re - enter the stage variables and the framework. I want the playback head to return to scene 1: frame 1. Please help!

Thank you

I can guess, but try the following...

function replay_ecard(event:MouseEvent):void {}

gotoAndPlay (1);
}

If you have more than one scene, you can then change this line to be... gotoAndPlay (1, "scene 1");

If this resolves the issues, then you must provide the full error message you get.  My guess is that the error is to try to say a button symbol to browse a timeline... something that he is unable to do.

Tags: Adobe Animate

Similar Questions

  • Hello! I can't subscribe to creatively Cloud for photographers. When you subscribe to gives an error when you pay with the card: "order processing error occurred for more information, please contact the Customer Service by phone 8 800 333 36 63."

    Hello! I can't subscribe to creatively Cloud for photographers. When you subscribe to gives an error when you pay with the card: "order processing error occurred for more information, please contact the Customer Service by phone 8 800 333 36 63, when making a payment via PayPal: PAYMENT_CPG_SETTLE_FAILED. How to order?

    Contact adobe during the time pst support by clicking here and, when available, click on "still need help," http://helpx.adobe.com/x-productkb/global/service-ccm.html

  • The line of code for the change of color in FindChangeByList.txt

    Hello

    I would like to know how the following line of code would look like if I want to change the color of the letters 'u' - to the color red? :

    grep{"findWhat:" \u0075 ""}{changeTo: 'u', appliedFont: 'Sabondiacritic', fontStyle: "Regular"}{caseSensitive:true, includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}Find out all the letter x and replace it with the Arabic word.

    Like this:

    Help is appreciated as always!

    With regard to Camille

    Try this,

    {changeTo:"\u", appliedFont:"Sabondiacritic", fontStyle:"Regular", fillColor:"C=15 M=100 Y=1000 K=0"}
    

    but don't know why you use unicode \u0075 in the Grep search... instead, quite simply, you can use "\u".

  • Single Dev Environment and line of Code for 6 and CC?

    Hi all

    So far, we develop for customers who have used only InDesign CS5.5 and CS6 - using Extension Builder 2.1.

    The problem is that now, a new customer has only CC.1 2014 (they have just bought today). I found a hack how to create an Extension using 2.1 for 2014 CC/20141. However, this hack does not support expansion cards, we need because we want to fly control panel the control panel menu.

    Also, I think that CC 20141 supports only the panels of HTML5. Is that mean a total rewrite of our code? And since CS6 does not support HTML5 panels - do we now maintain 2 parallel lines of code until the last of our customers migrate to CC?

    I would appreciate any advice.

    Kind regards

    mlavie

    Hello

    I can't talk about InDesign for expansion cards, but for the total rewriting of all your parts of code... I guess you're right. If you are going to support both Flash and HTML panels, you must develop them independently (at least for the Panel itself - the actual writing of scripts can be moved easily).

    Have you checked here for cards? Adobe CEP resources by Adobe-CEP

    Kind regards

    Davide Barranca

    ---

    www.davidebarranca.com

    www.cs-extensions.com

  • I need code for my button to listen to the music without duplication...

    Hello!!.. First of all, I'm sorry because my English is not good enough. I'm of the Spain.

    I am doing a project in Flash CS5, but it's a mess...

    I need to make an app to read in the Flash Player. My project has two buttons, one to replay the project and a second to reach a specific image. My problem is that when I press my button to start over, the music start of frame 0 and not from my specific image. Also, if I press my button once more and my video starts again, the music splits. As you can see, I put a code on my button for listening to music (it s in a layer) since its inception as the video, without duplication. Apart from that, I like to keep the option of playing music indefinitely when my video stops (it has a stop at the end).

    Thank you very much!!

    You can use:

    on (release) {}

    gotoAndPlay (1);

    stopAllSounds();

    _root.my_sound. Start (0,0);

    _root.gotoAndStop ("stop")

    }

  • need help to write correct code for nested button

    This is the code in the main timeline.

    Stop();

    garage.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

    function mouseDownHandler(event:MouseEvent):void {}

    gotoAndPlay ("open");

    }

    The movieClip gDoor is nested inside the garage and 'open' is a label on this chronology.  I know that the gotoAndPlay ("open"); is not correct.  How would be the label on nested timeline.

    the link below is to download the FLA

    clienttestsite.X10.MX/beta/garage.fla

    The problem is that you have an event listener assigned to the garage, which is block / casting interaction with what anyone inside.  When you click the button on the chest, you are always clicking on the garage, making the gotoAndPlay("open")... where he stops to the stop();

    One way around this problem is to assign an instance name to the door and to assign the code to open to...

    Stop();
    garage.door.addEventListener (MouseEvent.CLICK, openHandler);
    function openHandler(event:MouseEvent):void {}
    garage. Play();
    }

    garage.chest.closeBtn.addEventListener (MouseEvent.CLICK, closeHandler);
    function closeHandler(event:MouseEvent):void {}
    garage.gotoAndPlay ("close");
    }

    Note: as shown in the code above...

    -Use the CLICK instead of MOUSE_DOWN.

    -in the openHandler use play() instead of gotoAndPlay ("open"). You are already in the 'open' setting, and it is only because the stop() is exhausted only it actuallys works.

    Do what I explained above also makes so that you can click on the door to close it that way.

  • Need information of Java code for services

    Hi Experts,

    Can you please give information about where I'll get the Java code for java api services.

    Example: For VisitorManager, where I'm going to get its details information.

    There are also many other api services, then where I will find its detail.

    Thank you

    Ravi

    Following links may help you.

    Sites API Java Docs - https://docs.oracle.com/cd/E29542_01/apirefs.1111/e39356/toc.htm

    Asset API Tutorial - https://docs.oracle.com/cd/E29542_01/doc.1111/e29634/asset_api_tutorial.htm#WBCSD2387

    REST API - https://docs.oracle.com/cd/E29542_01/doc.1111/e35835/wemrestresources.htm#WBCSR354

  • Code for the button located inside the MC

    I decided to rearange my flash site and now things do not work.

    I used to have a collage of images where images have been keys and each image was on the scene (which made a scene with 10 + bulk images)

    I made a button to each image. Here is an example of code for one image named "icysophistication_app_btn". Labour code because it was previously:

    icysophistication_app_btn.addEventListener (MouseEvent.CLICK, onClick_IcySophisticationPopUp);

    function onClick_IcySophisticationPopUp(event:MouseEvent): void {}

    gotoAndPlay ("icysophistication");

    So I decided to unite all the images in a mc, called 'imgscollage_buttons_mc' (because later I want to build an another collage and drag them on the screen with tweener engine)

    imgscollage_buttons_mc.icysophistication_app_btn.addEventListener (MouseEvent.CLICK, onClick_IcySophisticationPopUp);

    function onClick_IcySophisticationPopUp(event:MouseEvent): void {}

    gotoAndPlay ("icysophistication");

    I guess I have to put something before - gotoAndPlay ("icysophistication");

    But what can not understand.

    Please suggest

    Thank you for responding, I thought of her. Somehow the instance names are automatically removed once I transferred all the buttons in the mc.

    I must just go and apply again all the button instance names.

  • code for the button send, anyone?

    Hello

    I am currently using this code on a button and it does not work - I want to just that he open an email, so that the viewer can contact:

    var mail:URLRequest = new URLRequest("mailto:[email protected]");
    
    myButton.addEventListener(MouseEvent.CLICK, goMail);
    
    function goMail(event:MouseEvent):void {
         navigateToURL(mail);
    }
    
    
    Any ideas as to why it isn't working? I am applying it to a layer above the button, but it just doesn't want to play - Help! 

    Your source code should work.  The problem may be in your configuration somehow.  I recommend that you place an order to trace to the inside of your event handler function to see if yes or no button really speaks to the function.

    var mail: URLRequest = new URLRequest ("mailto:[email protected]");

    myButton.addEventListener (MouseEvent.CLICK, goMail);

    function goMail(event:MouseEvent):void {}
    trace ("in office");

    navigateToURL (mail);
    }

  • Tried to start Windows Mode safe start in normal mode after that screen remained on the lines of code for about 5 minutes...

    I know I have a virus. I scanned my system several times with many different scanners, but nothing is detected. Internet begins to act a bit funny, connection fast enough in the video stream and more. Never happened before...

    Hello

    ·         The computer starts normally now?

    ·         Which antivirus program is installed on the computer?

    Try the following.

    Method 1: Run the Microsoft Safety Scanner to search for infection by the virus. Check out the following link.

    Microsoft Safety Scanner - free online tool for PC health and safety

    Method 2: Optimize Internet Explorer.

    How to optimize Internet Explorer

    Method 3: Follow the steps in the article mentioned below.

    Increase the speed of the PC: optimize your computer, help your PC run faster

    See also:

    How to set performance options in Windows XP

    If the computer does not start then normally, reply with the exact error so that we can help you best.

  • I need windows 7 activation code for windows 7 32 bit product id 00342-OEM-8992752-30004 Starter

    I bought win 7 starter edition PC oem, I miss my lic key
    product key ID 00342-OEM-8992752-30004

    If Windows 7 is preinstalled by the PC manufacturer then that it will be already activated it.  Go to Control Panel, System - the row above the product ID should give you the activation status - what does say here?

    You should make a note of the product key - that is the key that you enter if you need to re - activate for some reason any.  The product key is on the certificate of authenticity [CoA].  The CoA label will be on the lower part of the PC or hidden in the battery compartment.  The COA will also indicate the edition of Windows 7 product key apply to the - in your case, it will say Windows 7 Starter [it could also have "OA" after the name, but that is not significant].

  • Recover not lines of code for the types of objects such as procedures, pk,


    Hello

    Is it possible that I can retrieve the number of lines in a procedure or package? Added what can I retrieve this information for each procedure in a schema in a single query?

    Thank you very much!

    Reddy

    Hi Reddy,

    I think you can read of views dba_source or all_source...

    Thank you

    Christel

  • Codes for the button layers still CS6

    Successfully, I create my own buttons for Encore CS6.  I note in the layers the character in square brackets to create buttons + just as much! RC = etc. for other functions.  I see not yet included in the website for the forums.  I find it difficult to get detailed Help Menu for buttons.  Given that to enrich Encore Menus in Photoshop, I find myself here.

    Where can I find a complete list of all special characters in the media used in a layer with functional descriptions create button?

    The list is in the help file.

    Adobe still * using Photoshop to create menus

  • That's why when I press the button to increase volume on my pc, I suddenly a developer kit that broadcasts the line of code on my computer? I'm really confused

    have firefox open a strange thing happens when I increase the volume on my computer, the high and the low volume are the F11 and F12 keys if I press volume down on my toolbar and albums completely disappear? If I press volume up I suddenly a toolbar developer appear at the bottom of my screen streaming lines of code for what im page currently on

    F12 is the default key to open the Toolbox of the integrated developer same as Ctrl + Shift + I

  • What's wrong with my muliple drag and drop code?

    I've got ParaA, Perrault and ParaC ( http://img.photobucket.com/albums/v292/pancreasboy/misc/para.gif ) who are dragable mc (ie they have buttons inside them with the code below), they may fall on the mc Para1, Para2 and Para3.

    Here is the code for the button appears:

    on {(press)

    startDrag (this, true);

    This.ox = this ._x;
    This.Oy = this ._y;
    }

    on (release) {}

    stopDrag();

    {
    If (this ._droptarget == ' / Para1 ')

    {
    _root. Para1.gotoAndStop (2);
    }

    If (this ._droptarget == ' / Para2 ")

    {
    _root. Para2.gotoAndStop (2);
    }

    If (this ._droptarget == ' / Para3 ")

    {
    _root. Para3.gotoAndStop (2);
    }

    on the other

    {

    This ._x = this.ox;
    This ._y = this.oy;

    }

    }

    stopDrag ();
    }

    When you drag ParaA all the MC Para1, Para2 or Para3, it executes the relative _root. Para # .gotoAndStop (2); but only clings to the Para3. Did I miss something?

    Thanks in advance.

    The "else" is only for the last 'if', which is the MC para3. So if the target was para1, it always checks the other ' if, and because it is not para3, it will run the "else" and return to the starting point.
    Achieve its connected by adding an 'else' for other targets:
    If (para1) {...}
    ElseIf (para2) {...}
    ElseIf (para3) {...}
    else {...}

    Alternatively, you can use a switch statement:
    switch (this ._droptarget) {}
    case "/ Para1":...
    break;
    case "/ Para2 ':...
    break;
    case "/ Para3:...
    break;
    default:...
    break;
    }

    HTH,
    blemmo

Maybe you are looking for

  • Bug on macOS Sierra

    IM currently using the BlueJ ide and after updating to the new system / update (macOS Sierra) there is significant lag / jitter when scrolling. This problem only occurs when you use the scrolling with two fingers with the touch pad. When I use a mous

  • T430s i7 - No. Thunderbolt?

    I just got my i7 T430S w / graphics nvidia in the mail and unboxed it. I noticed that the port in the back doesn't have the Thunderbolt logo but the logo to display port instead. I checked several times to ensure that the model I bought came with the

  • No internet after downgrading to Windows 8 for Windows 7 64 bit

    I went down to windows 7 and now my internet does not work nor are my fn keys especially one that turns the power on and off Wireless is not no longer works. I looked down my laptop and this is the model. "HP Pavilion n239ca-15 Notebook PC. He also s

  • How to upgrade to VISTA already installed after 5 years of use XP Pro

    I bought a Dell Vostro 200 in 2008, using XP Pro as operating system.   Apparently, Vista Business 32-bit SP1 is already installed on this PC - I have a DVD of resettlement for this. How can I move from XP to Vista?    I have no idea as to where he i

  • removeMenuItem does not?

    Is there something special that needs to be done to remove a menu item once it has been added to the menu? I create the menu item, then add in makeMenu, they appear very well and works, but at one point in my program I want to can remove the menu ite