Canvas of HTML, Javascript, coding for movement forward/backward a frame w / buttons?

Hi everyone, I am super new Flash/Animate and know very very little about AS2 and AS3 (or any other coding besides language)

I am trying to build a simple "module" to animate, somewhat like a PowerPoint where you can move the slide to the slide (or image in image) with help of the arrow keys. In the previous "modules" I built using AS2, I did this through the creation of buttons and their assignment of code that was something like -

{We (Release)}

nextFrame():

}

and

{We (Release)}

prevFrame();

}

and it was super easy.

However, now I'm working with canvas of HTML, because I need the modules to work on mobile devices, so I will try to write code in JavaScript.

I managed to achieve a code (after long hours searching through forums) which kind of accomplished what I try to do, but after the move an image forward my 'next' button stops working. The "previous" button works, but I can only test it after I went from an image in advance.

So here's my setup.

I have created a form that I've then nestled inside a movieclip and button I up this movieclip on the stage to create my buttons. I gave only one instance of the name of "prevBtn" and the other the name of the instance "nextBtn.

The layers are simply a background layer, my navigation layer (where the buttons) the image only key on my nav layer is the first image, then the buttons remain the same with the same instance for remaining executives names, a text layer (where I wrote a text on each image to say if she moves forward and backward) and a framework of actions.

On a frame of my layer actions, I put the following code.

This.Stop ();

var frameNumber = this.currentFrame;

nextFrame var = frameNumber + 1;

prevFrame var frameNumber = - 1;

this.nextBtn.addEventListener ("click", navNext.bind (this));

function navNext() {}

this.gotoAndStop (nextFrame);

}

this.prevBtn.addEventListener ("click", navPrev.bind (this));

function navPrev() {}

this.gotoAndStop (prevFrame);

}

If someone could please tell me why it does that to move to the front of a picture and then my "nextBtn' no longer works I would be VERY happy! Or is there another way to code this simple interactivity, THANKS!

You define frameNumber outside the service. So, you set the frameNumber only once, and so it won't give you the same number, chassis number following if ever this code exists. You have really no need create this variable for what you want to do. This should do what you want:

this.nextBtn.addEventListener ("click", navNext.bind (this));

function navNext() {}

this.gotoAndStop (this.currentFrame + 1);

}

this.prevBtn.addEventListener ("click", navPrev.bind (this));

function navPrev() {}

this.gotoAndStop (this.currentFrame-1);

}

Tags: Adobe Animate

Similar Questions

  • I downloaded a Coded for Movie Maker and tried to play a YouTube clip to edit and it shows nothing happening just the clip. If anyone can help I would really appreciate it

    I downloaded a Coded for Movie Maker and tried to play a YouTube clip to edit and it shows nothing happening just the clip. If anyone can help I would really appreciate it

    Hello

    I suggest you follow the link to import files into Windows Movie Maker below:

    http://Windows.Microsoft.com/en-us/Windows-Vista/importing-files-into-Windows-Movie-Maker-frequently-asked-questions

    I also suggest you check the Web site software codec for further assistance, or try another program to convert the files.

  • Hello, I bought the package creative cloud for a month, had a complete trial version. Already move forward payment, but I use coudnt (how can I instal)

    Hello, I bought the package creative cloud for a month, had a complete trial version. Already move forward payment, but I use coudnt (how can I instal)

    Hi Victoria,.

    Please check the help below document:

    Applications creative Cloud back in test mode after an update until 2015 for CC

    Kind regards

    Sheena

  • Mix ADF Faces with HTML, JavaScript, CSS, JSTL question

    Dear all,

    The project is now starting to deploy to the production server. When we try to deploy to the production server who made a lot of mistake. As this used widely used project mix ADF faces with
    HTML/JavaScript/CSS/JSTL. I would like to know what are the most error when we have mixed to use each one and how can we overcome them there?
    There is in the project

    1 mix of tags html with ADF Faces components
    2. the use of JavaScript/CSS inline
    3. mix the JSF/ADF Faces and JSTL tags

    Help me how to address this issues as well as links to useful blog.

    JDeveloper IDE version: 11.1.1.5.0 with Webcenter
    WebLogic version: 10.3



    Best regards
    KT

    Published by: KT on May 16, 2013 21:23

    Hello

    In addition to this project widely used mixture ADF faces with HTML, JavaScript, CSS, JSTL.

    JavaScript, CSS, and JSTL is not a problem, whereas - according to the JSF version - HTML is. JSF 2 is the first version of the JSF, which allows you to mix HTML with less side effects, if you use Facelets as view declaration language.

    I would like to know what are the most error when we have mixed to use each one and how can we overcome them there?

    There is in the project

    + 1. mixture of html with ADF Faces components tags +.

    This could ruin your pages, lead to update issues and - in case of frequent use in the trees - even destroy the functionality

    + 2. online use of JavaScript / CSS +.

    Poor performance because of heavy weight pages. If you were using ADF Faces and your JS addresses the DOM instead of the architecture of client cJavaScript ADF Faces then chances are JS will fail for the components that have changed their HTML output (which has an impact on the DOM structure) or changes are not submitted to the server.

    For CSS, CSS inlineStyle not applay to the DOM element that is external, which means for example af:input the background text color will color the lavel

    + 3. mix JSTL and JSF/ADF Faces tags +.

    Dependa on how you do. JSF has postponed EL syntax, which means that EL resolves at run time, whereas JSTL resolves at compile time. So the race conditions could become a problem

    Overall, it is difficult to say if things were coded wrong in the project (although for the use of HTML you can be sure) without seeing the code. It seems that the team that built the application however did not dare to the suite of recommended practices

    Frank

  • When I try to install an add-on, it load completely and said so "seconds remaining" and never move forward. What should I do to remedy this?

    When I try to install an add-on, it load completely and said so "seconds remaining" and never move forward. My connection and the computer properly. I have the latest version of Firefox, it is updated. I get this add-on for the mozilla site, what should I do otherwise?

    Please update your firefox latest version Firefox 25 and check whether the problem exists or not

  • I get this message at the startup of firefox: cannot open fileUnable mab to load the address book file history.mab I can delete and move forward but can't continue until it is deleted? Any suggestions on solving this problem?

    When I open firefox I get the following message: could not open the file failed to load the address book file history.mab mab I can delete this message and continue to use firefox, but must remove it until I can move forward. Any suggestions to fix this?

    This has happened

    Each time Firefox opened

    Is 10 days ago

    Are you sure that your question is about Firefox and not on Thunderbird?
    Firefox does not use a file history.mab

    See http://kb.mozillazine.org/Profile_folder_-_Thunderbird
    ---
    You can ask questions about the program of Thunderbird on MozillaZine Thunderbird Support forum.
    This forum is better suited for questions about Thunderbird, this forum is for the support for Firefox.
    See http://forums.mozillazine.org/viewforum.php?f=39

  • Router not configured for port forwarding

    I use a modem wireless to my ISP, they block all ports less than 1024 and I need to forward ports 80 & 440

    How can I solve this?

    If you configure your router for a LenovoEMC Personal Cloud and always see the message, "Not configured router for port forwarding" under personal cloud Configuration, one or more of the following ports are probably blocked by your internet provider (ISP): 80, 443or port selected in the range 50500-50599 .

    Port 80 is used for internet access (HTML UN-secure) in general. If this port is blocked, but the ports 443 and 50500 are open, the Personal Cloud will work correctly even if the error message appears.

    Port 443 is used for remote access on the host network storage device. If this port is blocked, but the port selected in the range 50500 is open, you will be able to use the Personal Cloud LenovoEMC and invite others to use it, but you will not be able to access your network storage device via the Internet URL. (See answer ID 30773 for more information on access remotely through Personal Cloud LenovoEMC.)

    A port in the range of 50500-50599 must be routed through the router to use the function LenovoEMC Personal Cloud. If this port is blocked by your ISP, you will not be able to access the Personal Cloud to your network storage device or invite others to join the Personal Cloud. (For more information, see answer ID 29070 .)

  • Cannot left click to advance to the next image in the image windows Viewer. I can move forward using the keyboard

    Cannot left click to advance to the next image in the image windows Viewer. I can move forward using the keyboard

    I have a folder of photos that I opened to see several thumbnails. I can left click on a picture and it will open full screen. Then I left click on this image and the next should show but nothing happens. I can use the keyboard arrows to move to the next photo, but I can't use the mouse. The left click works for everything I use it for. I've used regsvr32 /i shimgvw.dll and he said DllRegisterServer and DllInstall in shimgvw.dll succeeded. This does not solve the problem. This isn't a big deal, it just bugs _ on me because I'm a perfectionist. Thank you for your response and any other help would be appreciated.

    ===============================================
    If you use Windows Picture and Fax Viewer... left click of the photo is
    not supposed to promote the image. (some image viewers work this way
    but not Windows Picture and Fax Viewer)

    Left click on the blue arrows at the bottom of the screen will advance
    photos.

    See arrows in the following photo:
    http://blog.BrotherSoft.com/wp-content/uploads/2008/12/extend_200_image_support_for_windows_picture_01.jpg

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • app calls html/javascript kernel written in c / c ++

    Wonder if I can use html/javascript to call core application written in c / c++.

    I hope to put some entensive of calculation for the module written in c / c ++

    Is this possible?

    Welcome to any comment

    Hello. WebWorks for BB10 extensions are on the road ahead, and for now, there is an example of how to write a native extension with a JS source that will be used to the WebWorks app. See the discussion on the extension BB10 WebWorks, I've referenced the example in there.

  • How to call JavaScript/ExtendScript for first Pro CC Mac OS

    Looking for a way to run JavaScript aka ExtendScript in first Pro CC

    Here's what I have for other applications Adobe, using AppleScript:

    tell application "Adobe After Effects CC 2015"
      activate
      set SomeExtendScript to "ThisVariable='Runs This Js Code';"
      DoScript SomeExtendScript
    end tell
    
    
    tell application "Adobe Photoshop CC 2015.5"
      activate
      set SomeExtendScript to "ThisVariable='Runs This Js Code';"
      do javascript SomeExtendScript
    end tell
    
    
    tell application "Adobe Illustrator"
      activate
      set SomeExtendScript to "ThisVariable='Runs This Js Code';"
      do javascript SomeExtendScript
    end tell
    

    But so far nothing for first.

    tell application "Adobe Premiere Pro CC 2015"
      activate
      set SomeExtendScript to "ThisVariable='Runs This Js Code';"
      -- Does not work: DoScript SomeExtendScript
      -- Does not work: do javascript SomeExtendScript
      -- Does not work: do script SomeExtendScript
    end tell
    

    ExtendScript = JavaScript Adobe-flavored. Very similar.

    For other products Adobe AppleScript has been the key to do this.

    Yes, but there is no need to limit your solution to a single platform!

    I'd be curious to see what you do in AE.

    Instead of trigger ExtendScript some system based on external data, you can put the buttons in a panel of HTML5 (JavaScript based) for convenience of the user.

    Here is an example of PProPanel; other samples in the repository prettier HTML and use modern web frameworks; PProPanel is quite comprehensive in the use of agency ExtendScript API:

    Samples/PProPanel to master · Adobe-CEP/Samples · GitHub
    Pushing metadata to projectItems PProPanel = shows how to get the static value (metadata Panel) and temporal metadata (marker).

    Here is "how to set up a panel dev environment:

    Samples/ReadMe.md to master · Adobe-CEP/Samples · GitHub

    Work in the readme file, play with the sample and feel free to ask me anything!

  • When you place an object in InDesign, I can't move forward

    I am trying to place an eps file in a rectangle frame and when I do leather in the back. The option to move forward is not accessible (it is grayed out). I tried to add a 2nd layer and placing it there, but still remains on the back. Basically, I'm trying to put a picture as a background on the page. I talked to the support, but they were useless and directed me to the 1 page, I've read a hundred times. I'm hoping 1 of you can help me. I'm on a date deadline for early September, so I really need to get this figured out. Thank you!

    It's hard to be sure of your screenshots, but it looks like the version of the model that you have placed on the top layer is made entirely of white forms, which is my you can see everywhere where there are dark below, but not on the portion also white of the page.

  • Stop the slide to move forward unless the user clicks on the button

    Hello

    I'm working on a project where the user must click a next button to move to the next slide. The problem I have is that after I publish the project, the user can click anywhere in the project to move forward. They can click on an empty space at random and it will go to the next slide.

    Is anyway to prevent this?

    Thank you for the help,

    Matt

    How to set the action for this button? I hope that you authorized endless attempts? What version do you use?

  • ADOBE XI the Capitan Mac PRO. Impossible to open it. Despite a good SN I can't move forward.

    Acrobat Pro XI. I can't open it despite a good SN. I have the invoice of my purchase. Get a 'change of the SN"product is not listed. I can't move forward. What should do?

    Hi Tania,.

    This is the KB Doc: error: "this serial number is not for a product calling it" | Adobe Creative Suite you may wish to consult.

    Kind regards

    Rave

  • suspicion of JavaScript coding

    Hello

    Is there indication coding to javascript in dreamweaver?

    I don't have javascript coding hint when I, for example, to build features.

    On the other hand I have javascript coding hint in the Komodo Editor.

    Thank you

    DW code editor is not in the same League that some other editors I have to say however, Javascript code works of suspicion, for example, in this context:

    Start typing...

    var date = new Date(
    

    .. .at this point gets you code hinting for the Date object constructor.

    For me it's jQuery code hinting which is the biggest selling point for DW. I have actually come back to DW due to this.

    Start typing...

    $(window).
    

    .. .at this point I get the entire jQuery methods pop up. I love this

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.UK/

  • Help car game: move forward compared to changes of direction.

    Hey,.

    I was wondering how I can determine which coordinates my car needs when I press my keyboard compared to the directions that the car steers on-site.

    Basically, when I have the car I want to always move forward after that I flew.

    Here is the function that already, I have prepared:

    
    
    
    public function actions(event:Event):void {
    
    
    
    
    
    
    if (upKeyDown) {
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    }
    
    
    
    
    
    
    if (rightKeyDown) {
    
    
    
    
    
    
    
    
    this.rotation+=steering;
    
    
    
    
    
    
    }
    
    
    
    
    
    
    if (leftKeyDown) {
    
    
    
    
    
    
    
    
    this.rotation-=steering;
    
    
    
    
    
    
    }
    
    
    
    
    }
    
    

    Look for the line where it says:

    velocityX = Math.sin (this.rotation * Math.PI / 180) * speed;

    This velocityX (and velocityY) is used in the enter_frame function to set the position of cars on stage

Maybe you are looking for