Skip to main content
Deltaweb
Known Participant
November 10, 2022
Answered

Actionscript Resources for understanding workflow

  • November 10, 2022
  • 2 replies
  • 1521 views

Hello!

I am working in Adobe Animate to help create interactive, educational exe files that showcase animation, audio and video as well as allow for the user to control the flow of content via skip forward, skip backward, pause, play and volume buttons. I have already found tons of success through the Adobe Support community in setting up animation and audio with Animate along with getting the controls set up to be coded with AS3 and for that I am eternally grateful.

I understand that what I am attempting to achieve will be difficult in terms of video integration on an AS3 file, so I may be forced to animate in program rather than importing video to Animate from after effects. However I've run into a situation where I cannot seem to understand the workflow for using Actionscript 3 with Animate and I was wondering if there are any resources out there for using AS3 alongside Adobe Animate 2022? Relying on old videos of people using AS3 with flash don't seem to produce the intended results and I can't tell if the architecture keeps changing or if I just can't seem to understand the code. Even a lot of our old projects in office circa 2012-2013 break upon opening the fla file, so looking back at old projects for guidance feels like a dead end.


I have already bookmarked the AS3 Reference and the AS3 Developer's Guide, have done countless hours of research, debugging and video watching though I'm running into a continuous problem with understanding AS3 syntax and how it relates to layers on the timeline, symbols and scenes, and labels/instances/properties/actionscript classes. There also appears to be a discrepancy in a lot of the answers I read pertaining to starting code via importing packages vs. using simple commands such as gotoAndplay(). 

As an example of an area of trouble, I have attached a gif file of a simple button interaction that takes place within a movie clip across 100 frames. I intend to loop through these 100 frames until the user interacts with the button, forcing a jump to the frame at the beginning of a fade out into the full interactive animation.

There are 4 layers within this movie clip: The Title (static text), the grey/transparent screen underlay (png bitmap), the button & its start text (motion tween for glow effect, button), and the actions layer. The button glows blue, has instances of green coloring on hover and light orange on click, and begins a fade out after 100 frames. I have a very simple sample script previously sourced from an answer on these forums, however it does not seem to do what I intend and I cannot understand why.

Frame 99 (frame 1 script is identical minus the gotoAndPlay function)

gotoAndPlay("SplashScreen");
this.SplashScreen.startBtn.addEventListener(MouseEvent.CLICK,dostart);

function dostart(e:MouseEvent){
startBtn.removeEventListener(MouseEvent.CLICK,dostart);
gotoAndPlay("Fade");
}

 

Looking at the gif, the video will play through the first 100 frames, will not listen for a click and will cycle through the colors of the button once the video continues through the fade out. All of which are unintended functionality.

Here's a sample project so you can see what I'm working with if you feel so inclined to assist.

I guess long story short, are there resources that help explain the AS3 integration and workflow rather than just tell me what the answer to my Actionscript problem would be?

    This topic has been closed for replies.
    Correct answer kglad

    this object

     

    this.SplashScreen.startBtn

     

    must exist in the frame where this code executes:

     

     

    ie, if

     

    this.SplashScreen.startBtn

     

    exists on the SplashScreen frame and is not the same object on the frame with the code, your code will fail.

    2 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    November 10, 2022

    Hi.

     

    Here are some references that I hope will get you started.

     

    - Doug Winnie (ActionScript 1:1): https://www.youtube.com/watch?v=cX83rCeCz4A&list=PL6918DF35C37C7911&ab_channel=AdobeActionScript

    - Lee Brimelow (GotoAndLearn): https://web.archive.org/web/20121103120547/http://www.gotoandlearn.com/

    - LinkedIn Learning has some great video courses (special mention to Joseph Labrecque): https://www.linkedin.com/learning;

    - Pluralsight also have some great video courses: https://www.pluralsight.com;

    - My repo on GitHub that contains the source codes and files of some games, apps, and other stuff;

    - I also have a YouTube channel that you may find useful;

    - O'Reilly and Packt have lots of books about Flash, AS3, Animate, and so on, in paper or in a subscription fashion.

     

    Regards,

    JC

    Deltaweb
    DeltawebAuthor
    Known Participant
    November 10, 2022

    Thanks a ton for handing off these resources! I'll have a dive into the actionscript series to start, work down the line and continue to ask questions if they arise!

    JoãoCésar17023019
    Community Expert
    Community Expert
    November 10, 2022

    Excellent! Just let us know every time a question arises.

    kglad
    Community Expert
    Community Expert
    November 10, 2022

    that listener needs to be on a frame where dispatching object exists.

    Deltaweb
    DeltawebAuthor
    Known Participant
    November 10, 2022

    Thank you for the reply! My apologies for my own confusion, but by dispatching object, do you mean the startBtn since the act of clicking it would dispatch the program to the intended frame in the timeline? Or am I misinterpreting?

    Also, does this suggest putting it on the exact same frame on the layer with the object, or is an action layer spanned over the object an acceptable use case? I'm mainly trying to figure out the distinction between applying action code to movie clips versus the original objects

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    November 10, 2022

    this object

     

    this.SplashScreen.startBtn

     

    must exist in the frame where this code executes:

     

     

    ie, if

     

    this.SplashScreen.startBtn

     

    exists on the SplashScreen frame and is not the same object on the frame with the code, your code will fail.