How to convert this random pos AS2 code to AS3?

Hi! I'm doing a sort of screensaver and need to random the logo all over the screen. In ActionScript 2 it was easy, just paste some code to the object and it works. The things to do this is total different in ActionScript 3 and I can't figure out how to solve this. It would be nice if someone could take a look at my very simple example and point me in the right direction. Maybe there is some example out there done in AS3?
I can't figure out how to post fla so I renamed it to jpg. Just change the extension to fla again...
Regards / Jimmy

SORRY FOR THE LATE RESPONSE I WAS NOT ONLINE FOR THREE DAYS....
I am still not able to download the file.
What you can do is enclose the code which is called directly on the timeline in a function and call that function whenever required.
You can also send the file on my mail ID at [email protected] [Make sure you zip it and the version is saved in CS3]

Similar Messages

  • Convert onEnterFrame Event Handler  AS2 code into AS3

    My code of AS2 is given below. I do not know what event handler type is used and which event handler is used in AS3.
    onEnterFrame = function(){

    this.addEventListener(Event.ENTER_FRAME,onEf);
    // "this" references the movie itself, you can also use "stage" or the instance name of an object on the stage
    // look up addEventListener in the online help. This method takes two arguments, the event that you want to "listen" for and the name of the function to execute when the event occurs.
    // the function that will be called when the event occurs. It takes one argument that corresponds with the first argument of the addEventListener method.
    function onEf(event:Event):void {

  • 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);

  • How to convert this 'CAPITAL' in to small letter 'capital.'

    Hi All,
    I have a variable wk_text = 'CAPITAL'.
    How to convert this 'CAPITAL' in to small letter 'capital.'

    Hi,
    Use like below code.
    DATA text TYPE string.
    text = `Careful with that Axe, Eugene`.
    TRANSLATE text TO UPPER CASE.
    Regards,
    Pravin

  • 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)

  • 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?

  • How to convert this Servlet into JSP

    I am trying to convert this Servlet into JSP page.
    How do I go about doing this?
    Thanks.
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.text.*;
    /** Shows all items currently in ShoppingCart. Clients
    * have their own session that keeps track of which
    * ShoppingCart is theirs. If this is their first visit
    * to the order page, a new shopping cart is created.
    * Usually, people come to this page by way of a page
    * showing catalog entries, so this page adds an additional
    * item to the shopping cart. But users can also
    * bookmark this page, access it from their history list,
    * or be sent back to it by clicking on the "Update Order"
    * button after changing the number of items ordered.
    * <P>
    * Taken from Core Servlets and JavaServer Pages 2nd Edition
    * from Prentice Hall and Sun Microsystems Press,
    * http://www.coreservlets.com/.
    * &copy; 2003 Marty Hall; may be freely used or adapted.
    public class OrderPage extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    HttpSession session = request.getSession();
    ShoppingCart cart;
    synchronized(session) {
    cart = (ShoppingCart)session.getAttribute("shoppingCart");
    // New visitors get a fresh shopping cart.
    // Previous visitors keep using their existing cart.
    if (cart == null) {
    cart = new ShoppingCart();
    session.setAttribute("shoppingCart", cart);
    String itemID = request.getParameter("itemID");
    if (itemID != null) {
    String numItemsString =
    request.getParameter("numItems");
    if (numItemsString == null) {
    // If request specified an ID but no number,
    // then customers came here via an "Add Item to Cart"
    // button on a catalog page.
    cart.addItem(itemID);
    } else {
    // If request specified an ID and number, then
    // customers came here via an "Update Order" button
    // after changing the number of items in order.
    // Note that specifying a number of 0 results
    // in item being deleted from cart.
    int numItems;
    try {
    numItems = Integer.parseInt(numItemsString);
    } catch(NumberFormatException nfe) {
    numItems = 1;
    cart.setNumOrdered(itemID, numItems);
    // Whether or not the customer changed the order, show
    // order status.
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String title = "Status of Your Order";
    String docType =
    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
    "Transitional//EN\">\n";
    out.println(docType +
    "<HTML>\n" +
    "<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" +
    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
    "<H1 ALIGN=\"CENTER\">" + title + "</H1>");
    synchronized(session) {
    List itemsOrdered = cart.getItemsOrdered();
    if (itemsOrdered.size() == 0) {
    out.println("<H2><I>No items in your cart...</I></H2>");
    } else {
    // If there is at least one item in cart, show table
    // of items ordered.
    out.println
    ("<TABLE BORDER=1 ALIGN=\"CENTER\">\n" +
    "<TR BGCOLOR=\"#FFAD00\">\n" +
    " <TH>Item ID<TH>Description\n" +
    " <TH>Unit Cost<TH>Number<TH>Total Cost");
    ItemOrder order;
    // Rounds to two decimal places, inserts dollar
    // sign (or other currency symbol), etc., as
    // appropriate in current Locale.
    NumberFormat formatter =
    NumberFormat.getCurrencyInstance();
    // For each entry in shopping cart, make
    // table row showing ID, description, per-item
    // cost, number ordered, and total cost.
    // Put number ordered in textfield that user
    // can change, with "Update Order" button next
    // to it, which resubmits to this same page
    // but specifying a different number of items.
    for(int i=0; i<itemsOrdered.size(); i++) {
    order = (ItemOrder)itemsOrdered.get(i);
    out.println
    ("<TR>\n" +
    " <TD>" + order.getItemID() + "\n" +
    " <TD>" + order.getShortDescription() + "\n" +
    " <TD>" +
    formatter.format(order.getUnitCost()) + "\n" +
    " <TD>" +
    "<FORM>\n" + // Submit to current URL
    "<INPUT TYPE=\"HIDDEN\" NAME=\"itemID\"\n" +
    " VALUE=\"" + order.getItemID() + "\">\n" +
    "<INPUT TYPE=\"TEXT\" NAME=\"numItems\"\n" +
    " SIZE=3 VALUE=\"" +
    order.getNumItems() + "\">\n" +
    "<SMALL>\n" +
    "<INPUT TYPE=\"SUBMIT\"\n "+
    " VALUE=\"Update Order\">\n" +
    "</SMALL>\n" +
    "</FORM>\n" +
    " <TD>" +
    formatter.format(order.getTotalCost()));
    String checkoutURL =
    response.encodeURL("../Checkout.html");
    // "Proceed to Checkout" button below table
    out.println
    ("</TABLE>\n" +
    "<FORM ACTION=\"" + checkoutURL + "\">\n" +
    "<BIG><CENTER>\n" +
    "<INPUT TYPE=\"SUBMIT\"\n" +
    " VALUE=\"Proceed to Checkout\">\n" +
    "</CENTER></BIG></FORM>");
    out.println("</BODY></HTML>");
    }

    Sorry.
    actually this is my coding on the bottom.
    Pleease disregard my previous coding. I got the different one.
    My first approach is using <% %> around the whole doGet method such as:
    <%
    String[] ids = { "hall001", "hall002" };
    setItems(ids);
    setTitle("All-Time Best Computer Books");
    out.println("<HR>\n</BODY></HTML>");
    %>
    I am not sure how to break between code between
    return;
    and
    response.setContentType("text/html");
    Here is my coding:
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException
         String[] ids = { "hall001", "hall002" };
         setItems(ids);
         setTitle("All-Time Best Computer Books");
    if (items == null) {
    response.sendError(response.SC_NOT_FOUND,
    "Missing Items.");
    return;
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String docType =
    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
    "Transitional//EN\">\n";
    out.println(docType +
    "<HTML>\n" +
    "<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" +
    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
    "<H1 ALIGN=\"CENTER\">" + title + "</H1>");
    CatalogItem item;
    for(int i=0; i<items.length; i++) {
    out.println("<HR>");
    item = items;
    if (item == null) {
    out.println("<FONT COLOR=\"RED\">" +
    "Unknown item ID " + itemIDs[i] +
    "</FONT>");
    } else {
    out.println();
    String formURL =
    "/servlet/coreservlets.OrderPage";
    formURL = response.encodeURL(formURL);
    out.println
    ("<FORM ACTION=\"" + formURL + "\">\n" +
    "<INPUT TYPE=\"HIDDEN\" NAME=\"itemID\" " +
    " VALUE=\"" + item.getItemID() + "\">\n" +
    "<H2>" + item.getShortDescription() +
    " ($" + item.getCost() + ")</H2>\n" +
    item.getLongDescription() + "\n" +
    "<P>\n<CENTER>\n" +
    "<INPUT TYPE=\"SUBMIT\" " +
    "VALUE=\"Add to Shopping Cart\">\n" +
    "</CENTER>\n<P>\n</FORM>");
    out.println("<HR>\n</BODY></HTML>");

  • 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);

  • 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).

  • Help Converting old AS2 code to AS3

    I just updated an old flash file with some new photos.  I don't know much about Flash - enough to change the photos and hit export BUT now I'm getting errors.  I had a _root issue which I fixed thanks to this forum but I'm still getting these errors:
    Scene 1, Layer 'Actions', Frame 3, Line 14, Column 2
    1120: Access of undefined property timer1.
    Scene 1, Layer 'Actions', Frame 3, Line 18, Column 2
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 29, Column 2
    1120: Access of undefined property timer2.
    Scene 1, Layer 'Actions', Frame 3, Line 33, Column 35
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 34, Column 5
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 35, Column 17
    1120: Access of undefined property timer2.
    Scene 1, Layer 'Actions', Frame 3, Line 40, Column 2
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 40, Column 6
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 44, Column 16
    1120: Access of undefined property timer1.
    Preloader, Layer 'Actions', Frame 1, Line 1, Column 1
    1120: Access of undefined property bytes_loaded.
    Preloader, Layer 'Actions', Frame 1, Line 2, Column 1
    1120: Access of undefined property bytes_total.
    Preloader, Layer 'Actions', Frame 1, Line 3, Column 1
    1120: Access of undefined property getPercent.
    Preloader, Layer 'Actions', Frame 1, Line 3, Column 14
    1120: Access of undefined property bytes_loaded.
    Preloader, Layer 'Actions', Frame 1, Line 3, Column 27
    1120: Access of undefined property bytes_total.
    Preloader, Layer 'Actions', Frame 1, Line 4, Column 25
    1120: Access of undefined property getPercent.
    Preloader, Layer 'Actions', Frame 1, Line 5, Column 30
    1120: Access of undefined property getPercent.
    Preloader, Layer 'Actions', Frame 1, Line 7, Column 5
    1120: Access of undefined property bytes_loaded.
    Preloader, Layer 'Actions', Frame 1, Line 7, Column 21
    1120: Access of undefined property bytes_total.
    Preloader, Layer 'Actions', Frame 1, Line 8, Column 24
    1067: Implicit coercion of a value of type int to an unrelated type String.
    I didn't originally write the code and I don't know nearly enough about Flash to fix them.  Here's the code:
    stop();
    var fadeSpeed = 40; //Sets fad-in speed of images, default is 30
    var imageTime = 5; //Sets time each image is on screen, in seconds
    MovieClip(root).attachMovie("mc_Images", "mcFader", 10, {x:0, y:0});
    MovieClip(root).mcFader._alpha = 0;
    MovieClip(root).mcFader._visible = false;
    var imageNum = 1;
    startShow();
    function startShow(){
              timer1 = setInterval(loadImage, imageTime * 1000);
    function loadImage(){
              i = 0;
              imageNum ++;
              if(imageNum == MovieClip(root).mcImages._totalFrames + 1){
                        imageNum = 1;
              MovieClip(root).mcImages._x = 0;
              MovieClip(root).mcImages._y = 0;
              MovieClip(root).mcFader._alpha = 0;
              MovieClip(root).mcFader._visible = true;
              MovieClip(root).mcFader.gotoAndStop(imageNum);
              MovieClip(root).nextImage = imageNum;
              timer2 = setInterval(fadeImage, fadeSpeed);
    function fadeImage(){
              MovieClip(root).mcFader._alpha = i;
              if(i > 100){
                        clearInterval(timer2);
                        MovieClip(root).mcImages.gotoAndStop(MovieClip(root).nextImage);
                        MovieClip(root).mcFader._alpha = 0;
                        MovieClip(root).mcFader._visible = false;
              i = i + 10;
    function goLink(fNum){
              clearInterval(timer1);
              MovieClip(root).mcImages.gotoAndStop(fNum);
    ANY help would be GREATLY appreciated!! 

    Ok, I researched a little.
    The variable i is set to 0 in loadImage, which is called by a timed out function startShow, which is called directly.
    So I was right to surmise I=0, but you don't even need to define it yet.
    If you add
    var i;
    var timer1,timer2;
    to the top of the program, all the variables are defined globally, which as far as I can see is the intention.
    That leaves me with one undefined variable and curious syntax:
    r36:
    this.mcImages.gotoAndStop(this.nextImg age);
    What is intended here? Age is never defined. I guess it might be defined by Flashvars, as in as2, these would be accesible as a root variable, but this doesn't mean much to me. I'd expect something like this.nextImg+age or something.
    So I searched again: nextImg is not defined but I found this.nextImage = imageNum;
    So there is just a space that got in there somehow.
    Fixed that and it compiles, but immeadeately after compilation you get a problem with attachMovie
    this.attachMovie("mc_Images", "mcFader", 10, {x:0, y:0});
    This is a as2 way of taking things out of your library and placing them as a child of another.
    The new way to do that is to make a clip accessible in your library and then instantiate a new class with:
    var mcFader:mc_Images= new mc_Images();
    this.setChildIndex(mcFader,10);
    mcFader.x=0; // this is not needed, as it is default, as it was in as2, so it was obsolete there as well!
    mcFader.y=0;// this is not needed, as it is default, as it was in as2, so it was obsolete there as well!
    this.addChild(mcFader);
    There are some other issues after that,
    I would have to look at the source to fix them, because they have to do with the structure of mc_images. Which is not in code, but in your library.
    The whole code would the look like this:
    stop();
    var fadeSpeed = 40; //Sets fad-in speed of images, default is 30
    var imageTime = 5; //Sets time each image is on screen, in seconds
    var mcFader:mc_Images= new mc_Images();
    this.setChildIndex(mcFader,10);
    mcFader.x=0; // this is not needed, as it is default, as it was in as2, so it was obsolete there as well!
    mcFader.y=0;// this is not needed, as it is default, as it was in as2, so it was obsolete there as well!
    this.addChild(mcFader);
    this.mcFader._alpha = 0;
    this.mcFader._visible = false;
    var imageNum = 1;
    var i=0;
    var timer1,timer2;
    startShow();
    function startShow(){
             timer1 = setInterval(loadImage, imageTime * 1000);
    function loadImage(){
              i = 0;
              imageNum ++;
              if(imageNum == this.mcImages._totalFrames + 1){
                        imageNum = 1;
              this.mcImages._x = 0;
              this.mcImages._y = 0;
              this.mcFader._alpha = 0;
              this.mcFader._visible = true;
              this.mcFader.gotoAndStop(imageNum);
              this.nextImage = imageNum;
              var timer2 = setInterval(fadeImage, fadeSpeed);
    function fadeImage(){
              this.mcFader._alpha = i;
              if(i > 100){
                        clearInterval(timer2);
                        this.mcImages.gotoAndStop(this.nextImgage);
                        this.mcFader._alpha = 0;
                        this.mcFader._visible = false;
              i = i + 10;
    function goLink(fNum){
              clearInterval(timer1);
              this.mcImages.gotoAndStop(fNum);
    jencreates wrote:
    I just updated an old flash file with some new photos.  I don't know much about Flash - enough to change the photos and hit export BUT now I'm getting errors.  I had a _root issue which I fixed thanks to this forum but I'm still getting these errors:
    Scene 1, Layer 'Actions', Frame 3, Line 14, Column 2
    1120: Access of undefined property timer1.
    Scene 1, Layer 'Actions', Frame 3, Line 18, Column 2
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 29, Column 2
    1120: Access of undefined property timer2.
    Scene 1, Layer 'Actions', Frame 3, Line 33, Column 35
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 34, Column 5
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 35, Column 17
    1120: Access of undefined property timer2.
    Scene 1, Layer 'Actions', Frame 3, Line 40, Column 2
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 40, Column 6
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 44, Column 16
    1120: Access of undefined property timer1.
    Preloader, Layer 'Actions', Frame 1, Line 1, Column 1
    1120: Access of undefined property bytes_loaded.
    Preloader, Layer 'Actions', Frame 1, Line 2, Column 1
    1120: Access of undefined property bytes_total.
    Preloader, Layer 'Actions', Frame 1, Line 3, Column 1
    1120: Access of undefined property getPercent.
    Preloader, Layer 'Actions', Frame 1, Line 3, Column 14
    1120: Access of undefined property bytes_loaded.
    Preloader, Layer 'Actions', Frame 1, Line 3, Column 27
    1120: Access of undefined property bytes_total.
    Preloader, Layer 'Actions', Frame 1, Line 4, Column 25
    1120: Access of undefined property getPercent.
    Preloader, Layer 'Actions', Frame 1, Line 5, Column 30
    1120: Access of undefined property getPercent.
    Preloader, Layer 'Actions', Frame 1, Line 7, Column 5
    1120: Access of undefined property bytes_loaded.
    Preloader, Layer 'Actions', Frame 1, Line 7, Column 21
    1120: Access of undefined property bytes_total.
    Preloader, Layer 'Actions', Frame 1, Line 8, Column 24
    1067: Implicit coercion of a value of type int to an unrelated type String.
    I didn't originally write the code and I don't know nearly enough about Flash to fix them.  Here's the code:
    stop();
    var fadeSpeed = 40; //Sets fad-in speed of images, default is 30
    var imageTime = 5; //Sets time each image is on screen, in seconds
    MovieClip(root).attachMovie("mc_Images", "mcFader", 10, {x:0, y:0});
    MovieClip(root).mcFader._alpha = 0;
    MovieClip(root).mcFader._visible = false;
    var imageNum = 1;
    startShow();
    function startShow(){
              timer1 = setInterval(loadImage, imageTime * 1000);
    function loadImage(){
              i = 0;
              imageNum ++;
              if(imageNum == MovieClip(root).mcImages._totalFrames + 1){
                        imageNum = 1;
              MovieClip(root).mcImages._x = 0;
              MovieClip(root).mcImages._y = 0;
              MovieClip(root).mcFader._alpha = 0;
              MovieClip(root).mcFader._visible = true;
              MovieClip(root).mcFader.gotoAndStop(imageNum);
              MovieClip(root).nextImage = imageNum;
              timer2 = setInterval(fadeImage, fadeSpeed);
    function fadeImage(){
              MovieClip(root).mcFader._alpha = i;
              if(i > 100){
                        clearInterval(timer2);
                        MovieClip(root).mcImages.gotoAndStop(MovieClip(root).nextIm age);
                        MovieClip(root).mcFader._alpha = 0;
                        MovieClip(root).mcFader._visible = false;
              i = i + 10;
    function goLink(fNum){
              clearInterval(timer1);
              MovieClip(root).mcImages.gotoAndStop(fNum);
    ANY help would be GREATLY appreciated!! 

  • Convert as2 code to as3

    Please help me to convert this code..............
    for (i = 1; i <= nextballs; i++)
            nextarray[i] = new Array(0, 0, 0);
            attachMovie("balls", "nextballs" + i, kkk++);
            _loc2.inGame["nextballs" + i]._x = xnext;
            _loc2.inGame["nextballs" + i]._y = ynext + i * 60;
            _loc2.inGame["nextballs" + i]._xscale = 140;
            _loc2.inGame["nextballs" + i]._yscale = 140;

    var nextballs:int = 4;  // <- nextballs needs to be defined, though need not be defined this way.
    for (var i:int = 1; i <= nextballs; i++)
            var nextarray[i]:Array = new Array(0, 0, 0);
    this["nextballs"+i]=new balls();
    addChild(this["ballballs"+i]);
    // xnext and ynext need to be defined and should probably be updated in this for-loop
    // this part of your code makes no sense given your attachMovie() statement.
            _loc2.inGame["nextballs" + i].x = xnext;
            _loc2.inGame["nextballs" + i].y = ynext + i * 60;
            _loc2.inGame["nextballs" + i].scaleX = 1.4;
            _loc2.inGame["nextballs" + i].scaleY = 1.4;

  • What is this little AS2 code in AS3?

    Hey guys!
    I got something to embed HTML with it's pics and text and stuff...
    But this is in AS2.0 and I would need it in AS3.0..
    I was checking the AS2.0 migration on Adobe website, but I can't find / don't know some things..
    What I got in AS2.0:
    function(){return A.apply(null,[this].concat($A(arguments)))}
    myLoadVars = new LoadVars();
    myLoadVars.onLoad = function() {
    myText.htmlText = myLoadVars.myHTMLdata;
    myLoadVars.load("myHTML.txt");
    And to where I got by myself (not much AND IF this is correct..):
    function(){return A.apply(null,[this].concat($A(arguments)))}
    import flash.net.URLLoader
    myLoadVars = new URLLoader();
    myLoadVars.onLoad = function() {
    myText.htmlText = myLoadVars.myHTMLdata;
    myLoadVars.load("myHTML.txt");
    Could someone help me with this plz?
    Thanks!

    Hey thanks for the fast answer!
    This is totaly it!
    I forgot something stupid in my own AS3... lol
    BUT when I copy your code, I get a error.. You made a very very very little mistake...
    function(){return A.apply(null,[this].concat($A(arguments)))}
    var myLoader:URLLoader = new URLLoader();
    myLoader.addEventListener(Event.COMPLETE, onLoad)
    myLoader.load(new URLRequest("myHTML.txt"));   ----> That's what you forgot :-)
    function onLoad(e:Event):void
         myText.htmlText = e.target.data;
    Edit yours a bit or something... I'll give you the correct answer thingy :-)
    Thanks very very much! :-)

  • How to convert this BSO formulas into ASO formulas ?

    I need some help to convert this BSO formulas into ASO formulas:
    BSO formulas:
    12*("Head Count"->"Terminated"/((@PRIOR("Head Count"-> "Total Active & Leave")+"Head Count"->"Total Active & Leave")/2));
    "Head Count" is a member of the Account dimension
    "Terminated" and "Total Active & Leave" are members of the Status dimension
    Existing Active
    New Hire
    Active
    MAT
    STD
    OTH
    Leave
    Total Active & Leave
    Voluntary
    Involuntary
    Death
    Retirement
    End of Temp Assignment
    Terminated
    LTD
    Total Status
    Promotion Within Level
    Promotion to Higher Level
    Promotion
    No Total Status
    All Status
    Status (Dimension)
    In ASO, the formulas will be ??
    Thanks

    Try
    CASE WHEN IS([Period].CurrentMember, [Jan]) THEN
    12 * (([Head Count], [Terminated] ) /
    ((( [Head Count], [Total Active & Leave], [Dec], [Year].CurrentMember.lag(1) ) +
    ([Head Count], [Total Active & Leave])) / 2))
    ELSE
    12 * (([Head Count], [Terminated] ) /
    ((( [Head Count], [Total Active & Leave], [Time].CurrentMember.lag(1) ) +
    ([Head Count], [Total Active & Leave])) / 2))
    ENDTake note this assumes your Year dimension is in descending order
    Year
    --2007
    --2008
    --2009
    If Year is in Ascending order
    Year
    --2009
    --2008
    --2007
    Then you need to change
    [Year].CurrentMember.lag(1) to
    [Year].CurrentMember.lead(1)

  • As2 code to As3 conversion please

    Hey, could someone help me converting the following code to AS3. Thanks for any help..
    id=_root.id;
    if(this._y<>_root.txk){
    this._y=_root.txk;
    _root.txk+=60;
    this._x=_root.txx;
    textyazı="";
    onEnterFrame=function(){
    this._name=namet.text;
    if(_root.txk==360){
    _root.txx+=60;
    _root.txk=60;
    this.onPress=function(){
    if(_root["t"+namet.text].txtn.text<>namet.text){
    _root.attachMovie("txt_dd","t"+namet.text,_root.derinlik);
    _root["t"+namet.text]._x=100;
    _root["t"+namet.text]._y=100;
    _root["t"+namet.text].txtyname.text=namet.text;
    _root["t"+namet.text].txtn.text=namet.text;
    _root["t"+namet.text].txtyazılar.text=textyazı;
    _root.derinlik++;
    txtac = SharedObject.getLocal(id);
    setInterval(function(){
    if(txtac.data.namet<>"" && txtac.data.id>0){
    namet.text=txtac.data.namet;
    textyazı=txtac.data.textyazı;
    id=txtac.data.id;
    }else{
    namet.text=_name;
    if(namet.text=="undefined"){
              namet.text=_name;
    if(textyazı==undefined){
              textyazı="";
    },50);
    this.useHandCursor=false;

    1.download flashdevelop (Flash has bad code hinting and error descriptions)
    2.start with deleting underscores in _root,_x,_y
    3.work your way up from there
    4.Lines like:
    this.onPress=function
    are probably attached directly to a button or MovieClip: This is not possible in as3 anymore. You have to take the code out of the button and put it on the timeline of the button, if it is a MovieClip.
    5.The Event Model has changed considerably:
    onEnterFrame=function(){
    // do stuff here
    is now
    addEventListener(ENTER_FRAME, enterFrameHandler);
    function enterFrameHandler(e:Event):void{
    //do stuff here

Maybe you are looking for

  • Don't want to view previous items in month view

    Hi guys, I don't use iCal for much, but I'm trying to make a simple calendar of events. There are several events, and they last for a month and a half or so each. I've created the event and I'm having it repeat until the specified date. Let's say the

  • Error while applying Patch 4960210

    Hi, I am trying to integrate oracle apps with Oracle EBS 12R and following Doc Id:376811.1 from metalink. I have successfully installed patch 5983637, but when I try to install patch 4960210 on it, even though I stopped all the services on app server

  • Problem with update

    I just updated from 1.0.0.15.57 to the latest version listed in the update dialog box (11.something). After the update installed, it prompted me to restart SQL Developer so I clicked yes. The application splash screen popped up for a second and it ne

  • How do I delete blank space at end of file?

    I am absolutely new at this and am poking around without getting an answer to what seems like a simple question. I imported a 45-second MIDI file created in Finale without a problem, but after the "block" numbered 36 along the top of the Arrange wind

  • Download Dimensional Modeling Book (Star Schema Design Book)

    Hello Friends, You can download an IBM Book on Dimensional Modeling from the following link: http://www.redbooks.ibm.com/abstracts/sg247138.html?Open This is an excellent IBM Redbook on Data warehouse design and Dimensional Modeling design. Great to