Create a button link URL in AS3 when outside the class is used.

I need help!

Quick background - I'm the guy at work who has the most basic understanding, base, base of Flash and was installed.  Makes me the guy ' go to ' now.  I've been avoiding AS3 for a few years now because I'm not a software engineer and my coding knowledge is quite limited. I have googled around for an hour and get something in AS2.  Not so much with AS3.  We have recently upgraded to Flash CC and had removed all previous versions, so now I have no choice.  I can follow directions but the technical jargon associated with AS3 is a learning curve steep for me when I do something like that, maybe twice a year.

Now, what I'm trying to accomplish:

It is simple stupid.  I have a flash web-banner.  The background is a static image of the PNG.  It has a countdown to a date.  I need the whole banner to function as a button so that when you click on it, it takes the user to a Web site.  That's all.  That's all I need.  I was able to do this in AS2 before without much of a fight.

So I did the countdown using the script from this site:

http://blog.anselmbradford.com/2009/08/03/creating-a-date-countdown-timer-in-ActionScript-3-Flash /.

It works by referencing classes by external script.  It took me a bit of tinkering, but I got it together, no problem.
So I'm going to make a button.  I create a button object.  Invisible, place it on a layer above all the rest.  I apply this code in action:

MyButton.addEventListener (MouseEvent.CLICK, f);

function f (e: Event) {}

navigateToURL (new URLRequest ("http://www.adobe.com"));   Use the url of your choice.

}

And then it breaks.  The SWF up errors and will not compile.
First of all, he says:
1180: call to a method may be undefined, event.

So I import flash.events.Event. Then, I get:
1180: call to a method may be undefined navigateToURL.

1180: call to a method maybe not defined URLRequest.

1180: call to a method may be undefined addFrameScript.

1120: access of undefined property MouseEvent.

So I add:

import flash.net.navigateToURL;

import flash.net.URLRequest;

import flash.events.MouseEvent;

Who clears all errors except the 1180: addFrameScript.  What I've read, when there is an external class used, I can't apply action in a frame on the timeline script?
It is so far above my head.  I tried for hours yesterday to find a way to add the script to the button to the main class, but the closest I had been set on my button never compile errors.  I don't know what I'm doing here and why it is so difficult to do two things at the same time in AS3.  I'm just frustrated with all this now.

Could someone take pity on me and tell me what I need to do to get this working?  Try to use small words and talk to me like I'm the fool of the village, which is how I feel right now.

Thank you!

change this to the following and retest:

Joshua Fowler wrote:

I think you're right. Under the parameters of the publication, that's what 'Class' is pointing.

This is the first main part of the code:

package com.anselmbradford

{

import flash.display.MovieClip;

import flash.events.TimerEvent;

import flash.utils.Timer;

SerializableAttribute public class Main extends MovieClip

{

/**

Create a new object of Countdown, listen to updates and pass the date to countdown to.

*/

public void Main()

{

var cd:CountDown = new CountDown();

cd.addEventListener (CountDownEvent.UPDATE, _updateDisplay);

CD.init (new Date (2015,3,9,20,00));

}

/**

* Update the display.

*/

private void _updateDisplay (evt:CountDownEvent): void

Does this sound correct?

Thanks again!

Tags: Adobe Animate

Similar Questions

  • Can I create a button that will load a graphic on the page?

    I want to create a page where users can change the colors in a chart by clicking on a set palette (series of colorful buttons)

    I want them to be able to define a background color (from a predefined file selection), and then a secondary color (also amongst a selection of predefined file include transparency).

    For example, imagine a polka dot design. I would like the user to specify the background color and the color of the polka dots by clicking on the buttons of the same color on the page. I have a series of background files and a series of pea files (where everything but the polka-dot Jersey is transparent).

    Is it possible to create buttons on a page that, when clicked will load a graphic to a certain size and location?

    Would appreciate any input.

    Thank you

    Nick

    This should be possible with 2 widget compostion nested:

    The composition of 'parent' contains background on the triggers and the images corresponding to the target colors. The transition between the targets must be set to 'Fade '.

    The 'child' widget, is nested within the widget 'parent', its bottom of target must be transpaent to show the underlying background of the composition of 'parent' and its triggers contains the color of the polka dots. Its objectives show the points himself.

  • How to create a button to run an insert and remove the statement

    Hello. I have a tabular presentation page that allows me to view the contents of a table and update the data in two columns of the table. I want to create a button on the same page and when the button is clicked the following actions occur

    1. Insert a new table all the values in the table as a table where the two editable fields are not null.
    2. remove from the table in a table all records where the editable fields are not null
    3. back to the current page... This will show me all the lines where the editable fields are always set to null.

    I tried to do this by creating a button manually and by using a sql expression to first try the Insert... It did not work. So I'm looking for a pointer to what would be the best method.
    Concerning
    Craig

    Hello

    create the button with "Defined by the dynamic action" action.

    The creation of a dynamic action on the button who has run the PL/SQL code

    Kind regards
    Richard

    -----
    blog: http://blog.warp11.nl
    Twitter: @rhjmartens
    If you answer this question, please mark the thread as closed and give points where won...

  • iPad 6 will link to google maps when off the grid

    My iPad 6 will link to Google Maps when I have wi - fi, cellular and wi - fi Assist turns off? I want to test OK cards before the holidays, and my iPad still seems to allow Google Maps. Thanks for your help.

    Only if you download and cache the maps of the area you will be in advance.  Google maps, as cards of Apple, is a display of live stream for visual mapping data.  But if you're looking for the Gizmodo and others tutorials on how you can cache a limited amount of data Google Maps for offline use.

    Otherwise, you're better off investing in one of the applications offline maps - IE. cards apps that include download (able) full card displays for guidance in offline or navigation.

  • Is there a way to create a button etc to get different views of the same page?

    I have a page full of product images and wants to give the viewer an option to choose the size of the images on the page. So far, I just had two different pages with the same images and created a hyperlink button to switch between views. The reason why I want to get the two points of view on the same page, is I want to use the same name for each page. Muse won't let me create two pages with the same name, so now I have a parent page "Products" (with large images) and its child page "products 2" (with the small images) with a hyperlink linking them. "» This also creates a problem in the menus, since the 'product 2' does not have the active menu bar.

    I have the same problem with the creation of the site in different languages. I would like to make a simple drop-down list with options "Suomi" and "English". What I have to create two different sites in two different languages and have just the hyperlink connect for example home pages?

    Thanks for the tips!

    You can use any number of widgets to create online pop-overs / hover pods / galleries. Lightbox to the ToolTip, anything is possible. The language issue to indeed create individual sites and crosslink them.

    Mylenium

  • Problems with the links/e-mail addresses when viewing the PDF in the browser ONLY

    Hello

    I just sent a PDF with an email address in.  There seems to be a strange problem: If the pdf file is downloaded and watched in Adobe Reader, links mailto behind text messaging addresses work as usual (for example. [email protected]). However, when this pdf is displayed directly in the browser (Chrome on Windows 7) by using the built in pdf viewer all double letters in the mailto is deleted (for example. [email protected]), but the text itself remains unchanged.

    There are two examples of that in both cases, the two double letters.

    I just tried a test with ' [email protected] ' as the test address.  Once again, the mailto link shows as "mailto: [email protected]'.»»  Remove the first double letter, but keeping the second!

    Any suggestions?

    Thank you

    Matthew

    Sorry, you will need to file a complaint with Google on this subject; Adobe has nothing to do with the viewer of PDF of Chrome.

    Or configure Chrome to use the Adobe Reader plugin: http://helpx.adobe.com/acrobat/kb/pdf-browser-plugin-configuration.html

  • Creating an external link in a field based on the value of another field

    Have 2 fields in a table: CR_Number and CR_Link (two varchar2s). If a CR_Number is filled in the data form, the CR_Link will be filled with a link to an enterprise application manager to open this application from Apex.

    This is my original formula of SharePoint: = IF ([VC #] = "","","< a href =" http://intranet.att.com/oneattcr/crsummary.cfm?crid= "& [CR_Number] &" "target = '_blank' >" & [CR_Number] & "< /a >" "). I tried to reflect the HTML but does not work. It's my current to DECODE syntax:

    DECODE (CR_NUMBER, NULL, Null,'|) CR_NUMBER:')

    Where I'm going wrong? Appreciate any help. Thank you!

    Not connected to the test currently but should be something like;

    DECODE(CR_NUMBER,NULL,Null,''||CR_NUMBER||'')
    

    Published by: Craig C March 22, 2013 21:18

  • Import of stored outside the class of XML as3 code?

    Hello

    I have the following code string stored in an XML file:

    MovieClip (parent) .gotoAndStop (15);

    That I imported it to the global var....

    Globals.Data.navtest

    ... to help...

    Globals.Data.navtest = test.toString ();

    It works very well - if I trace (globals.data.navtest); It generates MovieClip (parent) .gotoAndStop (15);

    What I want to do is now actually use globals.data.navtest in my Flash project to run MovieClip (parent) .gotoAndStop (15);

    How do I do that?  I have to import it as something other than a string, or do I have to code something that says flash 'run the code that is in globals.data.navtest?

    I want to keep all the code in the XML tag, if I can change this without opening Flash CS4.

    Thanks for your help guys.

    Shaun

    I don't know how this works, but if you just need global vars you can use a class as they are global http://greenethumb.com/article/11/global-variables-in-as3

  • Button Play/Pause in AS3

    I search on the internet, but I can't find a simple way to create a button play/pause in AS3. All the solutions I find are for older versions so buttons could applied actionscript directly on them.

    I created a flash animation and exported as a .swf to work with a single layer in a new .fla file. I have three layers created, button, video and actionscript. What I need is a button that looks like a pause button when the animation is played, and to stop the animation when you click on it. Would be nice if it could also pass to a play button when paused.

    It may be due to the where you have placed the code. Here's a basic example: HERE

  • Why is popupFetchListener called not to each time on the button/link click on?


    Hello world

    My version of Jdeveloper is 11.1.2.3.0.
    I created a page, consisting of a single button (also created link later).
    When I click on the button/link a pop up opens, in the popupFetchListener I created a method. Everything works fine when I load the page and click on the button/link for the first time.
    When I click on the link/button second time the popupFetchListener method is not called.

    What can be the reason behind this?
    How will I be able to call popupFetchListener whenever I click on the button/link?


    your suggestions will be really useful.

    Thank you.

    Please use

    triggerType = 'action '.

    Thank you.

  • Create a button 'contact us' in a skin of WinHelp?

    I use RH11 and using XP blue skin.  I want to create a button 'Contact us' which opens opportunities for the user pre-loaded with our email address and a subject line of "request for additional information.  William Van Weelden has provided a javascript to a button contact us who draws the title of the topic and the title of the LINK, but I do not know how to change to this effect.

    Is there an easy way to do this?  I am also willing to simply create an image on the skin which just open Outlook and pre-populates with our email address and use only HTML, if that's a better road.

    Thank you!

    Hello

    Should be pretty simple to achieve.

    I think that I've documented how to do this in my lean to the Skins folder. You can download here:

    Click here

    And after you download it, you will have to unlock.

    Click here to unlock info

    See you soon... Rick

  • Create a button to run

    Hello. I would like to know how can I create a button 'Run' on a Vi so that the operator should not go to the menu bar start Vi, if possible. Thank you

    Use a state machine and make sure that the VI is set to perform at the opening. Start in an idle state. A VI used by an end user should never be in editing mode or stopped.

  • Links to external .AS files after the conversion to AS3 canvas

    After you convert an AS3 project in canvas, objects that were previously linked to a file external .AS, containing their class to the library as always appear related to this class, as follows:

    2.JPG
    but I get no choice but in the environment of the AS3 to 'Change the class' and implement these for editing external .AS files, as you can see here:

    Capture.JPG

    Can I still retain the binding object in Javascript and how do I do in the environment Adobe animate CC, please?

    In the library, you can double-click on the column link to any element and give it a name of link. Later, it is used like this:

    var something = new lib. Thingy();

    But there is no file class in HTML5 Canvas. If you want external CODE to participate you must convert it into Javascript and put it in the first picture inside the movieclip.

  • Creating a button 'save'

    Hello

    I know it's probably a very simple thing to do, but how, I create a button on a dynamic form that saves the document?

    Thanks in advance.

    You must use the syntax below to save the file...

    app.execMenuItem ('Save'); (GOLD)

    app.execMenuItem ("SaveAs");

    Niall had assembled a very nice shape to make you understand all the different menu items.

    http://forums.Adobe.com/message/2386025#2386025

    Thank you

    Srini

  • Oracle Forms URL not accessible outside the server

    Dear all,

    I am facing problems of access to the URL of Forms under Oracle Forms 11 g when you access from the server.

    Intended to test, I created a new Oracle Forms on a VMWare Server environment.

    Details on my environment

    Windows 2008 R2 64-bit Server

    Oracle Web Logic Server 11g R1 64-bit

    Oracle 11 g R2 64-bit forms and reports

    Oracle Database 11 g R2 64 bit

    Virtual machine network connection works fine. I am able to Remote Desktop, sqlplus and access the Admin of WebLogic Console (port 7002) from my local system.

    But when connecting to the URL of the form it does not connect. It gives me the following error. Forms URL works fine when accessing the server.

    It seems you're connected to the Internet, but you might want to try to reconnect to the Internet.


    By using the following URL format to access the Forms http://formsserver:7007/forms/frmservlet? config = < appname >


    Please let me know if anyone has the solution.

    Thank you

    Mohamed Yusuf Salih

    Be careful when you make changes.  If you are not familiar with the operation of the listeners, you can easily make a problem worse.  Assuming that you have installed using the "Deployment" installation option, the default non - ssl ports must be as follows:

    OSH - 8888

    Server administration WLS - 7001

    WLS_FORM - 9001

    WLS_REPORTS - 9002

    Once configured correctly, calling the forms or reports occurs through the same port of OSH.  Thus, for example:

    http://server:8888/forms/frmservlet ...

    http://server:8888/reports/rwservlet ...

Maybe you are looking for

  • I get a message that says: "this connection is not approved" whenever I try to access ANY Web site

    I looked through previous questions and remove any software suspicious (it was not really, just a Bing bar). I deleted firefox and reloaded it. I bought Norton Antivirus and ran a scan - nothing. Date and time on my computer are correct. Explorer wor

  • How to install word trademark

    Hello I would use the word/trademark as SHARP or any other brand name on the Pages of Macbook. I have all the Microsoft Windows in my Macbook. How do I install the font? or maybe the shortcut to do it's hard to believe the word/mark registered. Thank

  • iWork ' 09, iWork ' 06?

    Well, I am having some problems serious screen with my iMac which is under Snow Leopard. It's still usable, but I prefer not to use. So I'll start using my iBook G4 running Tiger until I have buy a new Mac. The iBook works very well for me, but I don

  • Technical problems; Lord of the Rings: battle for Middle 2 Earth

    I bought the Lord of the Rings: Battle for Middle Earth 2 is about 2 weeks now. I used it on my laptop but I recently got a new computer with a different operating system. My laptop was Vista (not sure if it was a service pack). The new computer uses

  • Wiring for GLC-SX-MMD in Cisco2960X

    Hello I have Cisco 2960 X configured with 2 modules of transceiver GLC-SX-MMD. It has main switch at the other end (not sure model. No.), configured with 2 modules of transceiver GLC-SX-MMD. I'm trying to find the Cisco cable that can connect to thes