Noob question: How to update very basic as2 code to as3.

I've been asked to update a web banner with old as2 code, and not being a coder or a regular Flash user, I'm stuck with what I'm sure is a simple problem. The code in the opening frame is;
function timeOut(pauseTime) {
  stop();
  pauseTimer = setInterval(this, "goPlay", pauseTime);
function goPlay() {
  play();
  clearInterval(pauseTimer);
After that there are a few frames that include timeOut(500); code, which seems basic enough, so I imagine my problems are all in the opening code.
I get 4 errors that all refer to Frame 1;
1120: Access of undefined property pauseTimer.
1067: Implicit coercion of a value of type CapOne_MM_648x480b_fla:MainTimeline to an unrelated type Function.
1067: Implicit coercion of a value of type String to an unrelated type Number.
1120: Access of undefined property pauseTimer.
Can anyone help or point me in the right direction? Thanks.

For the code you show there would be no need to convert to AS3 since between AS2 and AS3 it hasn't changed.  One thing you do need to do is declare variables and since pauseTimer is used in mutliple functions it needs to be declared outside any functions.  Another thing you need to do is specify the variable types, including the arguments passed into function.  As for the setInterval call itself it appears to be written incorrectly....
var   pauseTimer:Number;
function timeOut(pauseTime:Number) {
      stop();
     pauseTimer = setInterval(goPlay, pauseTime);

Similar Messages

  • Question:- How to update the Adobe Air Application Version.?

    Question:- How to update the Adobe Air Application Version.?

    Change the namespace declaration in the application descriptor.
    For example, to update version 1.0 to 1.5, change:
    <application xmlns="http://ns.adobe.com/air/application/1.0." ...
    to:
    <application xmlns="http://ns.adobe.com/air/application/1.5"

  • How to Update Business Place & Sec.Code Field in Posted Document

    Dear All,
    Pls suggest how to update Business Place & Section Code field in documents which are posted without entering Business Place & Section Code. Pls tell me how to achieve this without using Validations & Substitutions. Any table entries can be maintained for this? Kindly guide.
    Regards
    Abhijeet

    Hi,
         Thanks for sending the replay,
         I had already update the Material document through the J1INPP T. code. but it not use for update FI
         Document and i want to update Business Place & Section Code in FI document.
         Please suggest,
    Regards
    Abhijeet

  • Dummy Guide needed for converting AS2 code into AS3

    I have to convert my existing AS2 code into AS3, but I might as well be reading chinese. I never even began to learn AS3, it was still fairly new at the time and the class ended before we had an opportunity to even touch on it. My major was not web design, it was the print side of design. I took an additional class, after I graduated, to learn web design and our teacher told us, basically, that we were designers, not coders so we won't be getting much into actionscripting, beyond the basics. At the time I was relieved, but looking back, I really wish we would have gotten more into it. Bottom line, I need to learn now.
    Is there ANYONE that can help me out? I will list my code below, buy I am way beyond lost any help that can be provided, I would be so grateful!!!!
    On the main timeline I have the basic..
    stop(); -- I found the AS3 version, but I don't know what I'm looking at. I get "not_yet_set.stop()" and there are are 8 options I can choose from. I just want the timeline to stop until I tell it where to go next. And what is "not_yet_set"
    Then I have my buttons, which are, basically...
    on (release) {
    gotoAndStop("Home");
    Or "gotoAndPlay("Whatever");"
    I also have buttons for scrolling...
    on (press) {
    play();
    on (release) {
    stop();
    AND
    on (press) {
    _root.AboutMe_Controller.gotoAndPlay(…
    on (release) {
    _root.AboutMe_Controller.gotoAndStop(…
    For the on(release) command, this is what I found as the AS3 version: not_set_yet.dispatchEvent()

    because that's really as1 code, you have steeper learning curve than going from as2 to as3.
    first, remove all code from objects, assign instance names to your buttons and you can then start on as3:
    // so, if you name your home button, home_btn:
    home_btn.addEventListener(MouseEvent.CLICK,homeF);
    function homeF(e:MouseEvent):void{
    gotoAndStop("Home");
    p.s.  the not_yet_set stuff is there because you tried to use script assist or some other actionscript shortcut.

  • Help! Convert simple Flash AS2 code to AS3

    Hi everyone,
    I'm a Flash beginner and followed a tutorial: http://www.webwasp.co.uk/tutorials/018/tutorial.php ... to learn how to make a "live paint/draw" effect. I didn't realize  that if I made something in AS2, I wouldn't be able to embed it (and  have it work) into my root AS3 file, where I've got a bunch of other  stuff going on. I've tried following tips on how to change AS2 code to  AS3, but it just doesn't work. I know it's simple code, and that some  genius out there can figure it out, but I'm at a loss. Please help!
    Here's the AS2 code:
    _root.createEmptyMovieClip("myLine", 0);
    _root.onMouseDown = function() {
       myLine.moveTo(_xmouse, _ymouse);
       ranWidth = Math.round((Math.random() * 10)+2);
       myLine.lineStyle(ranWidth, 0xff0000, 100);
       _root.onMouseMove = function() {
          myLine.lineTo(_xmouse, _ymouse);
    _root.onMouseUp = function() {
       _root.onMouseMove = noLine;
    Thanks in advance!
    Signed,
    Nicolle
    Flash Desperado

    Considering the code is on timeline:
    var myLine:Sprite = new Sprite();
    addChild(myLine);
    var g:Graphics = myLine.graphics;
    addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
    function onMouseDown(e:MouseEvent):void {
         var ranWidth:Number = Math.round((Math.random() * 10) + 2);
         g.clear();
         g.lineStyle(ranWidth, 0xFF0000, 1);
         addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
         addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
    function onMouseMove(e:MouseEvent):void {
         g.lineTo(mouseX, mouseY);
    function onMouseUp(e:MouseEvent):void {
         removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
         removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);

  • Change as2 code to as3

    I used a tutorial http://www.flash-game-design.com/flash-tutorials/funky-flash-website-tutorial-5.html to make a menu for my application, I've tried following tips on how to change AS2 code to AS3, but it just doesn't work.
    menu = ["bulls", "about", "roster", "schedule"];
    var current = menu[0];
    for (var i = 0; i<menu.length; i++) {
    var b = menu[i];
    this[b+"_btn"].stars._visible = false;
    this[b+"_btn"].txt = b;
    this[b+"_btn"].onPress = function() {
    _root.site[current+"_btn"].stars._visible = false;
    _root.site[this.txt+"_btn"].stars._visible = true;
    current = this.txt;
    _root.site.content.gotoAndStop(this.txt)
    this[current+"btn"].stars._visible = true;
    this.onEnterFrame = function() {
    this[current+"_btn"].stars.s1._rotation += 1;
    this[current+"_btn"].stars.s2._rotation += 0.5;
    Thank you,
    Glenn

    Just a note. Function declarations in a loop is an EXTREMELY bad practice that will lead to many problems if it doesn't have some already. So, the following lines:
    for (var i:int = 0; i<menu.length; i++) {
        var b:String = menu[i];
        this[b+"_btn"].stars.visible = false;
        this[b+"_btn"].addEventListener(MouseEvent.CLICK,fn);
        this[b+"_btn"].txt=b;
        function fn(e:MouseEvent):void{
            this[current].stars.visible = false;
            var nam:String=e.target.parent.name;
            this[nam].stars.visible = true;
            current = nam;
            //MovieClip(root).site.content.gotoAndStop(this.txt)
    should be:
    for (var i:int = 0; i < menu.length; i++) {
         var b:String = menu[i];
         this[b+"_btn"].stars.visible = false;
         this[b+"_btn"].addEventListener(MouseEvent.CLICK,fn);
         this[b+"_btn"].txt=b;
    function fn(e:MouseEvent):void {
         this[current].stars.visible = false;
         var nam:String=e.target.parent.name;
         this[nam].stars.visible = true;
         current = nam;
         //MovieClip(root).site.content.gotoAndStop(this.txt)

  • How to Update the Basic Data text in Material Master.

    Hi Abapers,
    I have more than 5000 materials for update basic Data text inside Material Master.
    how to update basic data text using abap programe? is there any bapi or normal program?.
    anybody give me sample of this.
    Thanks
    S.Muthu.
    IT Dept.

    Hi
    You can do by using the FM SAVE_TEXT.
    Just populate text into table i_tline.
    Local data declaration
      DATA: l_wa_thead  TYPE thead, " Header
            l_wa_tline  TYPE tline. " Work area for tline
    Populate header
      l_wa_thead-tdobject = c_obj_material.
      l_wa_thead-tdname   = wa_data-matnr.
      l_wa_thead-tdid     = c_id_best.
      l_wa_thead-tdspras  = sy-langu.
      l_wa_thead-tdluser  = sy-uname.
      l_wa_thead-tdfdate  = sy-datum.
      l_wa_thead-tdtxtlines = '1'.
    IF i_tline[] IS NOT INITIAL.
       l_wa_tline-tdformat = c_slash.
       APPEND l_wa_tline TO i_tline.
    ENDIF.
    Text shd start from next line
      l_wa_tline-tdformat = c_slash.
      CONCATENATE c_text wa_data-text
      INTO l_wa_tline-tdline SEPARATED BY space.
    Append the new text to the int table
      APPEND l_wa_tline TO i_tline and l_wa_thead
      C* Local data declaration
      DATA: l_wa_thead  TYPE thead, " Header
            l_wa_tline  TYPE tline. " Work area for tline
    Populate header
      l_wa_thead-tdobject = c_obj_material.
      l_wa_thead-tdname   = wa_data-matnr.
      l_wa_thead-tdid     = c_id_best.
      l_wa_thead-tdspras  = sy-langu.
      l_wa_thead-tdluser  = sy-uname.
      l_wa_thead-tdfdate  = sy-datum.
      l_wa_thead-tdtxtlines = '1'.
    IF i_tline[] IS NOT INITIAL.
       l_wa_tline-tdformat = c_slash.
       APPEND l_wa_tline TO i_tline.
    ENDIF.
    Text shd start from next line
      l_wa_tline-tdformat = c_slash.
      CONCATENATE c_text wa_data-text
      INTO l_wa_tline-tdline SEPARATED BY space.
    Append the new text to the int table
      APPEND l_wa_tline TO i_tline.
      CALL FUNCTION 'SAVE_TEXT'
        EXPORTING
          client          = sy-mandt
          header          = l_wa_thead
          savemode_direct = c_check
        TABLES
          lines           = i_tline
        EXCEPTIONS
          id              = 1
          language        = 2
          name            = 3
          object          = 4
          OTHERS          = 5.
      IF sy-subrc = 0.
        COMMIT WORK.
    endif.

  • How do you load an AS2 swf into AS3?

    I think this is the way around my dilemma. How do you load and AS2 .swf into an AS3 file?
    thanks again!
    Steve

    check that code in your last thread:
    What is the  code to load a .swf file in AS3 on the same layer?

  • How to update Business place & Section Code for posted Documents

    Hi,
    I want to update business place and section code in existing documents, How to update business place and section code in the posted Documents. Is there any validation to check business place and section code while posting Document.
    Thanks in advance
    Best Regards
    Raj

    Hi Raynaju,
    Business place is an organizational unit and  it below company code level that is primarily used for reporting taxes on sales/purchases.
    For that no need to go for validation.Go to the field status and give the Business place & Section Code as required fields.
    There is a option in SAP as Document change rules.There give the company code,field name and account type
    Now you can change the fileds in posted document itself.
    May be this information is useful to you
    If you have any doubt feel free to ask
    Regards
    Aneesh
    Edited by: Aneesh kumarA on Jul 22, 2009 12:45 PM

  • Help plsss converting this AS2 code to AS3!!

    here is a little AS2 code that is in fact a photo gallery
    that i use in my site and i want to convert it to AS3 but i just
    cant seem to get it right... could someone plssss help me?!?!

    with what part are you having trouble?

  • Need assistance converting some AS2 code to AS3

    Hi,
    I have some simple AS2 code that brings in a MovieClip when
    you click a button. This is currently AS2, and I would rather
    convert it to AS3. I also have some code which closes the MovieClip
    upon button Click.
    The code I am currently using is below:

    addMC is the name of one of the event handler functions, not
    the button(s). the button instance names are: addButton and
    removeButton.
    To have three of them, duplicate what you see and have new
    variables, functions, and button names for all three sets, adjusted
    appropriately.
    I'm pretty sure this isn't over yet, I'm just giving you code
    per your defined scenario, which may have a hole or two in it. Try
    it out and see what you really want to do, then come back when you
    find out things need to be tamed in some way or aren't working as
    you want. There are more complicated ways to deal with a situation
    depending on what you really want, and I'm one who prefers to see
    some work done at your end that shows you've tried something (I'm
    not mean, much, I just have this thing about learning by doing).

  • Very Nube Question About Creating a Very Basic Application Bundle / Package

    I don't know anything about XCode or AppleScript, other than that they exist, so I'm coming at this with only conceptual knowledge of how applications on OS-X work. Nonetheless, I have a goal that I feel should be really easy to accomplish, I just don't know where to begin.
    What I have is an html file with an embedded flash project that also references some outside files, such as pdfs for printing. This was designed to live on the web, but in reality it will be shipped out on a CD. Right now, if you insert the cd, you see the file contents (the above mentioned HTML file, as well as two folders containing the flash files and the pdfs that are embedded in or linked out from the html file).
    This isn't very elegant, and doesn't accomplish the "app" feel I'm shooting for. What I'm wondering is: is there a way to create an application package that has the html file and content folders tucked inside of it, so that when a user clicks on the application package, the html file is automatically launched? What resources might you point me to in order to learn how to do this in a relatively short amount of time? (I'm not even positive if I'm using the correct terminology to search for solutions... is it an application package or an application bundle?)
    Now for the limitations:
    These files were generated on a Windows machine by an eLearning tool ("Articulate Presenter") and therefore really can't be fiddled with much. I can't open any of the flash files and change the directory paths for the resource files the main presentation needs. I'm fairly confident the presentation just refers to the folder the html file is in as its root, so if the file structure could stay relatively intact once all the files move inside this "bundle," I think everything will still work.
    The Articulate Presenter folks aren't particularly helpful in solving Mac compatibility issues, so I thought I'd pose my question here. If I'm not being clear, I am happy to add additional details. Thanks very much for your patience with, and willingness to offer advice to, a complete newbie.
    Cheers!

    It's even easier than you think.
    Open AppleScript Editor.
    Type in the following code:
    set htmlFile to (POSIX path of (path to me)) & "Contents/Resources/index.html"
    set openCommand to "open " & quoted form of htmlFile
    do shell script openCommand
    Then do File > Save, and use 'Application' as the file format.
    Then the "Bundle Contents" button on the toolbar will be enabled. Click it to open up the drawer.
    Drag your HTML content and resources into the drawer.
    Do File > Save again. Ta-da, you have your web-content packaged as an application.
    This assumes that the top-level has a file named index.html. If not, modify to suit.

  • Question:   How to update app with a new version with new SQLite tables?

    We're updating an application in the App Store, and haven't yet found good information on how to deal with updates to the SQLite Schema and data that should be transferred between apps.
    Anyone successfully done this?
    Q1: Does the old DB files stay on the iPhone after update? Does the installer do a "diff" between them? In our case, we just extended tables, rather than changing them, in hope that we can successfully move the data for users gracefully.
    Q2: If the installer does in fact wipe all the data and files on the app before install, is there a way to access the data before it updates, so the app can gracefully update the data?

    to Templeton Peck:
    Good Sir,
    I would thoroughly appreciate you responding in a helpful manner rather than punishing my question with no regard to my question. Your harsh, quick, and false judgement was certainly not appreciated here. In regards to the macbook release: I was simply wondering IF there were releases of information that I had not heard of. I wasn't asking you to spill rumors of never released info.
    Maybe you should read this material a little more carefully without hastily looking forward to ripping apart a wondering mac user.
    But in regards to the SQL, I enjoy the following:
    UPDATE table
    SELECT........

  • Design question - how to update a list?

    Hi there,
    design question: I have a table with the following columns:
    1. id
    2. ref_number
    3. ticket_number
    example:
    1 60 234
    2 60 256
    3 60 664
    4 60 237
    consider this - user can see on the screen the list of all tickets associated with ref_num (in the example above everything associated with 60)
    now I would like to UPDATE the list. The user might have added more to the list or, alternatively, remove from the list.
    The easiest thing to do is to DELETE all the list with ref_number=60 and then do INSERT
    Q: is this ok? if not, how would you update such a list if I don't have the id's of every row?
    thanks

    If you want to write code that's easier for you to write, you do whatever the hell you want.
    If you want to write good code, retain the ID.

  • Super Noob question, how do i share photos?

    My girlfriend and I bought our very first mac yesterday and we love it! We are in the slow transition of putting all our digital files from our PC to our mac and I have come across one problem.
    Do we have to upload every thing twice to put it on both accounts? I Figured once she loaded all the pics on her account I would be able to view and access them with mine.
    There must be some way to do this. If not my memory seems like it would fill up having all the same files loaded twice.
    Again, Super noob here, but loving it so much.
    Thanks.
    Message was edited by: Clearkidc

    Clearkidc
    Welcome to the Apple Discussions.
    There are two ways to share, depending on what you mean by 'share'.
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Remember iPhoto must be running in both accounts for this to work.
    Frankly, as you are brand new to Macs I suggest you use the above until you're more familiar with the machine and the Operating System.
    If you want the other user to have the same access to the library as you: to be able to add, edit, organise, keyword etc. then:
    Quit iPhoto in both accounts
    Move the iPhoto Library Folder to an external HD set to ignore permissions. You could also use a dmg.
    (Some people have had success putting the library in the Users/ Shared folder. If you do this make sure the file permissions are set to allow read/write access to everyone.)
    In each account in turn: Hold down the option (or alt) key and launch iPhoto. From the resulting dialogue, select 'Choose Library' and navigate to the new library location. From that point on, this will be the default library location. Both accounts will have full access to the library, in fact, both accounts will 'own' it.
    However, there is a catch with this system and it is a significant one. iPhoto is not a multi-user app., it does not have the code to negotiate two users simultaneously writing to the database, and trying will cause db corruption. So only one user at a time, and back up, back up back up.
    Regards
    TD
    Message was edited by: Terence Devlin

Maybe you are looking for

  • Quicktime player works on macbook pro

    what did i need to do to get my quicktime player works on my macbook pro?

  • To make  the Billing document header  updated with the new VAT number.

    Hi Experts Due the business requirement we change the VAT number of  customers  for the European countries. And now how can we ensure that the Billing document header gets updated with the new VAT Reg.Number for the existing Billing documents. The in

  • Setting default outgoing email address

    I have multiple email addresses that I use in Mail, on my MacBook. Most of them are gmail accounts. Two are godaddy accounts, with personal domain names. I want to have a "main" one (a gmail account) that all my mail goes out from. If I'm in the "wro

  • How to convert a date field with format (dd,mm,yyyy) to format (mm,dd,yyyy)

    Hello. How to convert a date field with format (dd,mm,yyyy) to format (mm,dd,yyyy) I have text field which has a databind to a date field. When I click on it, we can select the date, it is added on the format (dd,mm,yyyy). When I want to insert this

  • Filtering R/3 Material Groups and Material Types

    Hi, I am trying to filter the Material groups and material types during master data upload from R/3 to SRM 4.0 I am tried doing the following: 1. In Txn R2AR2, i set up the request for DNL_CUST_PROD1 for MARA-MATKL(Material Group) & MARA-MTART(Materi