AS creation on a layer actions and frame 1 of the main timeline

/ * Set up files, this program works 'actions are directly fixed on the buttons.
the instance names:
ball_mc
start_btn
stop_btn

The clip of ball is a simple animation that bounces a ball up and down, I dragged an instance of the latter staging and added ball_mc.stop; for a layer actions, I created in the main time line.

I added the following to the start_btn * /.
{We (Release)}
This.ball_mc. Play();
}

I added the following to the stop_btn
{We (Release)}
This.ball_mc. Stop();
}

This program works. I simply press the start and stop buttons. And the clip ball_mc instance
symbol start / stop when I press buttons.

/ * I'm trying to access the same buttons through the main time line. I have put all my actionscript on frame 1 of the layer and the same 'a layer called actions' layer actions. Here is the code I tried, but the ball_mc will not start or stop. Here's the code I used: * /.

This.ball_mc. Stop();
This.start_btn.onRelease = function() {}
This.ball_mc. Play();
}
This.stop_btn.onRelease = function() {}
This.ball_mc. Stop();
}

I hope that I'm not asking something as stupid, I tried just about everything I could. That's why I ask your help now.

Thank you
Dennis

remove the 'this' (s) of your codes:

ball_mc. Stop();
start_btn.onRelease = function() {}
ball_mc. Play();
}
stop_btn.onRelease = function() {}
ball_mc. Stop();
}

'this' inside a function can refer to the object assigned to the function.

Tags: Adobe Animate

Similar Questions

  • Using CS4 Flach and action script 2.0 how to move a specific frame in the main timeline when a movie clip instance come at the end of his chronology?

    Using CS4 Flach and action script 2.0 how to move a specific frame in the main timeline when a movie clip instance come at the end of his chronology?

    code on the last frame of your movieclip instance:

    _root.gotoAndStop ('whatever_frame');  will work unless this swf is loaded into another swf.  in this case, you must use a relative path to the main timeline (for example, _parent or _parent._parent etc.).

  • How to transform a layer object and a path at the same time?

    Hi all

    I know that I will start when you tell me the answer to this!

    I would really like to know if there is a way I can manage to transform a layer object and a path at the same time... or if there is no work around to get there.

    In a Word, for example I spend a VERY long time to create a drive complex around a very detailed object and then at the end note to what twisted and perspective, and would like to straighten.

    Of course I could turn and correct the object and then carefully turn the path - but it will not correct and I have to spend a lot of time the path of adjustment and make SURE, it is perfect.

    Are there not somehow, I was able to transform set?

    Usually, of course, I do all the correction to straighten and correct the perspective in advance, but in some cases after I am done creating the path I then notice that image could have used other adjustments.

    I appreciate all the advice you can get :)

    Thank you kindly,

    Christine

    Transform the layer and then target the way and make "Edit > Transform path > Again. If you make several changes on the layer, and then each time that validate you and leave transformation mode, remember to do the ' transform path > Again "to keep the layer and the synchronized pathname.

  • What is the relationship between the main timeline and timelines of symbol in Adobe Flash Professional CC?

    I am new to Adobe flash and tried to create an E-card for a class. My teacher said that it is better just to have a keyframe for each layer in the main timeline and do all the clips of animation and film on the deadlines of each symbol. I'm having a hard time to understand how it works. To illustrate my confusion, let's start with an example.  I have a kite I want to start flying to frame 20. The kite is a symbol, so I create movement to 20 image interpolation in chronology of the wing. 20 on the symbol Timeline frame occurs at the same time as frame 20 of the MAIN scenario, or are they completely separate instances of time?

    Part of my mission, is should I use code snippets to add an element of interactivity to the Ecard. My confusion about the timeline affects my ability to do so. My teacher said that you need a stop on the first keyframe code to make sure that things will not start before you click the play button. Can I put the stop action on the main timeline or in the timeline of each symbol, or both?  Let's say I want to create a button that makes the kite flies when I click it. Where to play action 'go to and play', in the Assembly of the wing?

    I would greatly appreciate any help from the community. I'm the kind of person who needs to understand how things work. I searched for days, watch videos and read articles, but I still need to find a resource that effectively dissolved my confusion on this subject. So if anyone knows of any tutorials that explain how the main timeline and symbol timelines coincide, please share them with me. Thank you very much for your time.

    (P.S. are CC Animate Adobe and Adobe Flash Professional CC the same?)

    Thank you both for responding. Yes, your answers were useful, but a bit Advanced. I hope that you don't mind me asking a few follow-up questions.

    For Pete47-

    So I put my stop() in the main timeline. How the actionscript in the main timeline code works on the chronology of the wing if the two are separate?  Why not put the ActionScript on chronology of the wing? Clearly, there must be an interaction between the main timeline and symbols, right?  When you say "you can drag the symbol on the main timeline and it will run when you start", what do you mean by that? Like GETTING started, in the main timeline or in the scenario of the symbol? As you can see I am very confused by there!

    For Colin.

    I thought that Pete said you want to only have a keyframe in the main timeline. Then, when you said... "you can do it with an interpolation of the main timeline... from the beginning to the final position," why would you animate the motion on the main timeline? Why not in the chronology of the wing, can create another symbol of the tail in this period?

    And if the schedules of chronology and main symbol are separated, how SYNCHRONIZE you together different symbols to their movement to work together? And why should it be like that anyway?

    I am new to the community here, the last thing I want to say because you two sounds very knowledgeable on the Flash. How did you get your start? Did you start by watching the tutorials, read the manual, or something else?

    Once more, you have my abundant thanks for taking the time to help.

  • Control the main timeline and chronology of built-in movie clip

    Good afternoon folks,

    I am trying to solve this problem.  I have a main scenario with an animation. (animation is not a clip).  I also have a clip film embedded in the main timeline. I want to control the actions of the main timeline AND the embedded animation at the same time.

    For example, when a user clicks on a button "pause", I want to stop the animation of the main timeline as well as the integrated clip. I figured out how to stop the main timeline using the stop(); command.  I also understood how to stop the film incorporated using the command _root.embeddedclipinstancename.stop ();  Problem is that I don't know the commands to stop the two things at the same time.

    I tried to find that an instance name for the main timeline, but there is no (I think). I know I could do the animation in the timeline in a clip, but I don't want to go that route.  Any ideas on how to control two things?
    Also, if possible, I would prefer not to use the _root command since I know that this can cause a conflict in Captivate.

    Thank you.

    Include the two commands that worked in your pause button code.  If your [ause button is on the main timeline, you don't need to use a reference of _root.  It is only really useful if you target some of child level object distance back to the main timeline.  You can _parent (and string them if necessary) instead of using _root.  As you will get in trouble unless you're on the _root timeline when using it.

  • communication in different frames on the main timeline of the mc

    Hello!
    It's a really stupid question, but I don't know really not hot to make it work

    in the main timeline, I had two clips, a 1 frame (I'll name mcA) and the other structure 2 (I'll name mcB)
    I got a button inside the mcA and if I clik button I want to go to section 2 of the mcB

    I play with this ACE

    {We (Release)}
    _root.gotoAndStop (2);
    mcB.gotoAndStop (2);
    }

    but it does not work...
    go to the second image and shows the first BCP framework, not the second

    can someone help me?

    Thanks in advance

    Cheers!

    well, I solved it

    I've added the following as the key:

    on (release) {}
    _root.nframe = 2;
    _root.gotoAndStop ("Catalogo");
    }

    then, in the second frame of the main timeline (frame of the mcB) added AS following:

    this.mcB.gotoAndStop (nframe);

    Thanks in any case kglad

    Cheers!

  • 1080 and 4 k in the same timeline

    Hello

    I just did the update days of first pro CC a 2014, 2015. 4

    Anyone know comment can have the 1080 and 4 k in the same timeline

    before it was automatically but there...

    Thanks in advance for your help

    I have not seen any change in behavior it. If you start to tell a sequence with a clip of 1080 and drop a clip k 4 on it, you should check if "Adapt to the size of the image" (checked) the edit/preferences dialog box, you probably prefer not controlled so that it uses "Set to framesize" by default.

    Other than that, just drag & drop, should be fine. Now, from a sequence with a k 4 clip then drop a 1080 on that... either you will get a small clip in black box or if you scale upward, a LOT of pixelation. Not normally what we prefer.

    Neil

  • Goto frame within a movieclip on the main timeline button

    So what I have is a button (then named) on the main timeline. I have a clip on this framework (on the main timeline) and the clip has 3 images I want to be able to scroll using the "Next" button located on the main timeline. How can I do this?

    Thank you

    assign the movieclip an instance name (in the properties panel - for example, mc) and use:

    Next.addEventListener (MouseEvent.CLICK, f);

    function f(e:MouseEvent):void {}

    mc.nextFrame ();

    }

  • Can I access a label inside a MC and then return to the main time line

    Here is my current set up.

    I have a section marked on the main timeline that has the icons of 12 different videos. Each icon acts as a button and brings a user to a section marked with a FLV Playback component work video to play the corresponding video. These marked sections are located on the main of the time.

    This methog is my very long time mainline. Is there a way to do an additional MC which will hold all the buttons of the video and then have this MC separated in marked sections.

    In other words can I access a label inside a MC and then return to the main time line?

    My current code to access the label placed on the main timeline is:

    HowTo_maininfo_mc.theArrangement_btn.addEventListener (MouseEvent.CLICK, theArrangement_btn_amimated_btnDown);

    function theArrangement_btn_amimated_btnDown(event:MouseEvent):void {}

    gotoAndPlay ("theArrangement");

    }

    What it would be like if my "theArrangement" label would be located inside a MC?

    Is there a specific code of if I want to have a close button located on the label inside a MC and he needs to get on a label located on the main timeline?

    You should have an image with an flvplayback component and having each button assign the variable value from a source that is used by your component:

    var sourceVar:String;

    function theArrangement_btn_amimated_btnDown(event:MouseEvent):void {}

    sourceVar = "arrangement.flv";  for example

    gotoAndPlay ("flv_pb");

    }

    ///

    and as part of the "flv_pb", use:

    yourflv_pb.source = sourceVar;  where yourflv_pb is your component instance name.

  • I accidentally moved my favorites on the menu. How can I undo this action and place bookmarks in the toolbar?

    Moved from my bookmarks toolbar by right-clicking on the icon and go to the menu. I would like to cancel this action and return the bookmarks on my toolbar.

    Try to use the personalization feature to drag it to the desired location.

    (Although you can right-click > move to the toolbar, you can use customize anyway because you probably don't want the double-button at the right end of the bar.)

    This article should lead you to it: Customize Firefox commands, buttons, and toolbars.

    Does it work?

  • "settings" option on the ground ' and 'frame mix' now, the movement is stuffy!

    Hello! "I messed with settings" option on the ground "and"frame blend"try to improve image quality already very low - and now plays and export stiff/jerky movement... !! For any help or suggestion would be appreciated! does anyone know how to return back or increase the fluidity in movement smooth - it's too late to cancel...  Mixture of framework does not work!  Thank you!!!  Cally

    To go back, you can use a backup or a registered copy.

    Mixture of frame on the timeline is only useful when the framerate of the element does not match that of the timeline.

  • Photoshop 2015: BUG? Layers panel auto-fait scroll to top when you select the text element with the text, creation/copy of layer tool and other actions

    This is a bug or a really bad and frustrating idea for a story.

    (1) in the layers panel, select a text layer, it highlights

    2) change to the text tool

    3) click on the text element in the workspace

    OR

    (1) select a layer in the layers panel

    (2) Ctrl-J, new layer by copying

    EXPECTED: Panel layers rest in the same position

    REAL: Panel layers scrolls the element selected or new layer to the top of the Panel. BORING.

    I do not need or want Photoshop to make decisions for me, space to work around to move without asking, or generally to spoil my flow!

    Please fix this or give me an option to turn it off as soon as POSSIBLE.

    autoscroll-problem.png

    You have successfully updated to 2015.0.1?

    The bug known as in the original message has been fixed in this version.

  • How to restore files to their original creation order after details view and choosing one of the possible sequences

    I need to restore iniside files a file in the order in which they were initially created, namely "unsequence" them. Should be simple and obvious, but I'm dead end (after decades of bits and bytes that the average life of most Americans. I'm embarrassed but need help!

    • Open the folder
    • Click view and make sure details is selected (click to select if it is not)
    • Right-click anywhere in the column headings, and then click on check creation Date

    Now, simply by clicking on the column heading "Date of creation", you can sort by creation date, click again to reverse sort on date of creation.

    Tricky

  • I need a script to perform a specific action and save file with the SAME name of document .jpg

    I have all my PSD master files registered as follows: mydocument_PSD.psd. I want to run a custom action to sharpening and then save the file as mydocument.jpg (note the part "_PSD" should be removed).

    I found this Photoshop-export-PSD-script/Export - PSD.jsx to edwardloveall/Photoshop-export-PSD-script master · · GitHub that gets me close to there, but that's a png and is the name of the document to the right and there is no action ran.

    Any ideas?

    This gives a try...

    #target photoshop;   
    
    main();
    function main(){
    if(!documents.length) return;
    try{
        var path = activeDocument.path;
        }catch(e){
            alert("This document has not been saved");
            return;
            }
    if(activeDocument.name.toString().toLowerCase().search(/_psd\.psd$/) == -1){
        alert("Filename is not in the correct format");
        return;
        }
    var fileName = activeDocument.name.toString().match(/[^_]*/);
    var savedState = activeDocument.activeHistoryState;
    doAction("savelarge","Action Set");
    //////////////////////////////////////////////////////////////////////
    SaveJPEG(File(path + "/" + fileName + "_large.jpg"),10);
    activeDocument.activeHistoryState = savedState;
    savedState = activeDocument.activeHistoryState;
    doAction("savesmall","Action Set");
    //////////////////////////////////////////////////////////////////////
    SaveJPEG(File(path + "/" + fileName + "_small.jpg"),10);
    activeDocument.activeHistoryState = savedState;
    };
    function SaveJPEG(saveFile, jpegQuality){
    jpgSaveOptions = new JPEGSaveOptions();
    jpgSaveOptions.embedColorProfile = true;
    jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
    jpgSaveOptions.matte = MatteType.NONE;
    jpgSaveOptions.quality = jpegQuality;
    activeDocument.saveAs(saveFile, jpgSaveOptions, true,Extension.LOWERCASE);
    };
    
  • Layer masks, and vector masks on the same layer

    Hello guys,.

    It's maybe a stupid question, but I'm unable to understand this one...

    If you make a selection on a layer and click on the button of the mask, you create a mask...

    But if you press the button mask once more, Photoshop puts a vector mask to this layer,

    right next to the layer mask.

    To be honest I couldn't do much thing with this vector mask, I've experimented with it, but I just

    cannot know, how it interacts with the layer next to her mask (if there is interaction that is).

    Can someone help me understand please?

    What is the ease of use to have a vector mask next to a layer mask on the same layer?

    An explanation with a paradigm would be nice!

    Thanks in advance.

    Hello

    They both hide the image. One will be based pixel, other vector editable. Here's and example of round soft mask on Mona combined with a mask vector hard sharp (on top a still life by Frida!)

    How you can use it, it's you.

Maybe you are looking for