Code works in the timeline panel, but not in the class

Hello, I have the following code which works in the timeline, but if I change it to the class I get this error.

I will be very happy if someone can help me solve this problem.

Error here:

TypeError: Error #2007: Parameter child must be non-null.
          at flash.display::DisplayObjectContainer/addChild()
          at Function/Main/private:completeMenuLoad/goContent()

Code scenario here:

import flash.display.*;
import com.greensock.*;
import com.greensock.easing.*;
import flash.net.URLRequest;
import flash.net.URLLoader;


var signUpUrl:URLRequest = new URLRequest("../swf/signUp.swf");
var logInUrl:URLRequest = new URLRequest("../swf/logIn.swf");


var content1Loader:Loader = new Loader();
var content2Loader:Loader = new Loader();


content1Loader.load(signUpUrl);
content2Loader.load(logInUrl);


var buttonA:Array = [signUp_btn, logIn_btn];

var prevOnStageLoader:Loader;

for(var i:int=0;i<buttonA.length;i++){
buttonA[i].addEventListener(MouseEvent.CLICK, goContent);
}
function goContent(e:MouseEvent):void
{
if(prevOnStageLoader){
TweenLite.to(prevOnStageLoader,1,{x:stage.stageWidth});
}
prevOnStageLoader=Loader(this["content"+(1+buttonA.indexOf(e.currentTarget))+"Loader"]);
      addChild(prevOnStageLoader);
      prevOnStageLoader.x = -1250;
      TweenLite.to(prevOnStageLoader, 1, {x:0, ease:Elastic.easeInOut});
}

Code of the class here:

package 
{


          import flash.display.*;
          import flash.net.*;
          import flash.events.*;
          import com.greensock.*;
          import com.greensock.easing.*;



          public class Main2 extends MovieClip
          {
                    private var signUpUrl:URLRequest = new URLRequest("../swf/signUp.swf");
                    private var logInUrl:URLRequest = new URLRequest("../swf/logIn.swf");
                    private var content1Loader:Loader = new Loader();
                    private var content2Loader:Loader = new Loader();


                    public function Main2()
                    {
                              content1Loader.load(signUpUrl);
                              content2Loader.load(logInUrl);


                              var buttonA:Array = [signUp_btn,logIn_btn];
                              var prevOnStageLoader:Loader;


                              for (var i:int=0; i<buttonA.length; i++)
                              {
                                        buttonA[i].addEventListener(MouseEvent.CLICK, goContent);
                              }
                              function goContent(e:MouseEvent):void
                              {
                                     if (prevOnStageLoader)
                                     {
                                               TweenLite.to(prevOnStageLoader,1,{x:stage.stageWidth});
                                     }
                                     prevOnStageLoader = Loader(this["content" + (1 + buttonA.indexOf(e.currentTarget)) + "Loader"]);
                                     addChild(prevOnStageLoader);
                                     prevOnStageLoader.x = -1250;
                                     TweenLite.to(prevOnStageLoader, 1, {x:0, ease:Elastic.easeInOut});
                              }
                    }
            }
}

OK, so the problem is SOLVED. I don't know where the problem was because I solved as so much ' try & test - try & test...» ', but

I think that the problem was a table that should look like this:

in the Main() public class

private var buttonA:Array = new Array();

in constructor

Button = [signUp, login];

and the full code here:

package

{

import flash.display. *;

flash.net import. *;

import flash.events. *;

import com.greensock;

com.greensock.easing import. *;

SerializableAttribute public class extends MovieClip Main2

{

private var container: charger;

private var content1Loader:Loader = new Loader();

private var content2Loader:Loader = new Loader();

private var signUpUrl:URLRequest = new URLRequest("..) ("/ swf/signUp.swf");

private var logInUrl:URLRequest = new URLRequest("..) ("/ swf/logIn.swf");

private var buttonA:Array = new Array();

constructor function

public void Main2()

{

content1Loader.load (signUpUrl);

content2Loader.load (logInUrl);

Button = [signUp, login];

for (var i: int = 0; i

{

buttonA [i] .addEventListener (MouseEvent.CLICK, goContent);

}

}

private void goContent(e:MouseEvent):void

{

If (container)

{

TweenLite.to (container, 0.8, {x: 1250, ease:Cubic.easeInOut});})

}

container Loader = (this ["happy" + (1 + buttonA.indexOf (e.currentTarget)) + "Loader"]);

addChild (container);

Container.x =-1250;

TweenLite.to (container, 0.6, {x: 0, ease:Quart.easeInOut});})

}

}

}

Tags: Adobe Animate

Similar Questions

  • Code works correctly with sql developer but not in shapes

    Hi, formulas [32 bit] Version 6.0.8.11.3 (Production)

    INSERT INTO DEFICIENCIES 
    
    SELECT I.ITEM_ID , S.ITEM_ENG_NAME , S.ITEM_ARABIC_NAME 
    FROM ITEM_DETAIL I , STOCK S 
    WHERE I.ITEM_ID = S.ITEM_ID 
    AND I.ITEM_ID NOT IN ( SELECT ITEM_ID FROM DEFICIENCIES )
    GROUP BY I.ITEM_ID , S.ITEM_ENG_NAME , S.ITEM_ARABIC_NAME 
    HAVING MAX(EXPIRY_DATE) <= TRUNC(SYSDATE)
    OR SUM(QUANTITY) = 0 
    UNION
    SELECT E.ITEM_ID , S.ITEM_ENG_NAME , S.ITEM_ARABIC_NAME 
    FROM EXPIRED E , STOCK S 
    WHERE E.ITEM_ID = S.ITEM_ID 
    AND E.ITEM_ID NOT IN ( SELECT ITEM_ID FROM DEFICIENCIES )
    ORDER BY ITEM_ENG_NAME ;
    

    When I used it in oracle forms, I have faced

    error 103 at line 15 column 2
    encountered the symbol "order" when expecting one of the following: 
    ;return RETURNING_ adn or group havign intersect minus start union where connect 
    the symbol "group was inserted before "order" to continue
    
    

    ?

    forms not authorized such use for «insert into...» Select... Of...  ORDER BY' with order by.

    but this use can be used in a database procedure.

    write your code in a database procedure.  your code will run.

  • diving USB hard drive appears on the Control Panel, but not on MY computer

    Drive hard USB part on the Contrlol Panel but not on my computer.

    Hi Frank,.

    Thanks for posting your query in Microsoft Community.

    If I understand you correctly, the external USB hard drive (HDD) appears in the control panel but does not seem to be detected in my computer screen. I will certainly help you to question, however, I would be grateful if you could answer a few questions to refine the question in order to provide you with better assistance.

    (a) what is the brand and model number. the USB HDD?

    (b) has detected before HARD drive in my computer screen? If so, did you do changes on the computer before this problem?

    (c) that you get an unrecognized USB device notification error message?

    The unit is probably go up at the same point one of the partitions and thus becoming "invisible". In

    in order to further diagnose the issue, I would suggest trying the following methods and check if the problem persists.

    Method 1:

    Try running the Fixit tool from the link below.

    Hardware devices do not work or are not detected in Windows


    Also, run the next fixit to solve common problems with USB devices.

    Diagnose and automatically fix the Windows USB problems

    If the problem persists, try the following method.

    Method 2:

    Remove and reinstall all USB controllers.

    1. Open Manager devices by clicking the Start button, click Control Panel, click system and security, and then, under System, clicking Device Manager. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.
    2. In the list of the categories of equipment, locate and expand Bus USB controllers.
    3. Right-click every device under the Bus USB controllers node and then click Uninstall to remove them one at a time.
    4. Restart the computer and let the USB controllers get reinstalled.

    Plug in the removable USB device and perform a test to ensure that the problem is solved

    Also, refer to:

    Updated a hardware driver that is not working properly

    Hope this information is useful. Let us know if you need more help, we will be happy to help you.

  • DVD burn with iDVD works on new DVD players, but not on older versions of the DVD player. Any suggestions?

    VDs that I burn with iDVD works on new DVD players, but not on older versions of the DVD player. Any suggestions?

    I'm using an iMac with OS X El Capitan 10:11.1 and iDVD 7.1.2.

    You use DVD + R disks?  Those who are not compatible with DVD players before 1997.  The DVD-R is compatible with all DVD players.

  • LifeCam HD-5000 works fine in other programs, but not in the Lifecam software accompanying

    My Lifecam HD-5000 works fine in other programs, but not in the Lifecam software that comes with it, I get "There is no camera connected to this computer." I tried to restart and uninstall then reinstall the software.

    Hello

    LifeCam HD-5000 - Support and warranty (3 years)
    http://www.Microsoft.com/hardware/en-us/p/LifeCam-HD-5000/7ND-00001#support

    Microsoft Hardware warranties
    http://www.Microsoft.com/hardware/warranties.mspx

    Support for WebCam
    http://www.Microsoft.com/hardware/digitalcommunication/support/default.mspx
    http://www.Microsoft.com/hardware/en-us/support

    Product Solution Center
    http://support.Microsoft.com/hardware

    MS material takes in charge and recourse in warranty (90 days support of)
    the date of the 1st call).

    1-800-936-5700 or 1-800 Microsoft (642-7676)

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • My DVD works on our television screens, but not on some of our friends in televisions

    My DVD works on our television screens, but not on some of our friends television screens.
    He plays a photo then restarts and then plays two photos then restarts then plays three photos then restart etc etc..
    What is a parameter when creating the video to digital photos or a parameter on television of our friends?

    It has nothing to do with the connected TV!
    It s is the DVD drive!

    Some players can't handle all CD or DVD! Which is one reason why the created image DVD does not work with the friend (s) disk drive.

    You will need to test various DVDs of different drive manufacturers. Some discs are more compatible as other drives

  • USB works in XP safe mode but not in "normal" mode.

    Hello

    Something has trashed my usb connection because none of them work.  They worked a few days ago, but not now.  The USB ports work fine in XP safe mode, but I can't make them work under XP 'normal '.

    I tried system restore to restore to when I know they worked (Saturday).  But the restoration said it cannot restore at this time there.  I drive four other date back (Thu, Fri, Thur, sea) and it woul don't restore of any of them.

    I went to the HP web page for this computer.  They have no USB drivers, so I download the chipset and installed driver.  It does not work.

    I tried to uninstall USB devices by using Device Manager.  Devide manager uninstalled, then I rebooted the machine and it reloaded automatically usb drivers.  But I can not use devices.

    I tried Device Manager-> select your hardware-> right click-> properties-> tab driver-> update driver-> online search for the driver.

    I tried to uninstall in safe mode, run usb.inf and then re-startup - which did not work.

    I am current internet search for USB drivers for this computer.  But I still found nothing.

    Anyone know where I can find USB drivers for the HP Pavilion a1515n or should I be looking for on google.  Currently, I'm looking Drivers USB a1514n.

    I would like to reinstall the USB drives, but I can't find them.  Or some otherway to get USB devices working again.

    Thanks for any help.

    Dennis

    All,

    I got it to work!

    I have not updated the driver for the USB hub.   However, I finally tried to update the driver for the USB EHCI controller.  Once I updated the driver for it, all the USB ports and the connected devices are recognized.

    Life is good again.   It took me 5 hours to understand that I had to update a different device driver, but hey - at least it works!

    Denni

  • Question about media queires working in FF, and CR, but not IE

    Hello

    I'm trying to understand why my meïdia queries work in FF and Chrome, but not Internet EX 11.

    The page here: http://skeeterz71.com/auto/dealers.html

    The form at the top of the page, the pictures and information must be centered on the page to these: If someone has the time to watch, I would appreciate it.

    @media (max-width: 775px) {}
    .bold-product-title {}
    text-align: center;
    }
    .product-image-left {}
    text-align: center;
    }
    {.dealer-title
    text-align: center;
    }
    {.dealer-location
    text-align: center;
    }
    {.dealer-phone
    text-align: center;
    }
    {.dealer-information
    text-align: center;
    }
    {*.search city
    text-align: center;
    }
    . Search-of-city-select {}
    text-align: center;
    }
    }

    Thank you

    P.S. I use Bootstrap, but don't know of a bs class that will focus in Tablet and phone discovers only.

    Too bad. Don't have a closing tag on the right to request above this one... I went on the css so many times trying to find the problem and do not see it until about the 10th time. Probably should call it a day.

    I noticed in the element inspect it is to say, he doesn't yet see the request of media at all. Which clued me and should have been my first thing I should in fact...

    FF and chrome seen the request and IE is not. Strange, but IE was right in this case. FF and chrome gave me a lot of slack :)

  • FancyBox - Working in Live View mode, but not in the preview

    Hello!

    I searched the forums for some answers, but I can't just understand what I am doing wrong. I'm really a beginner with Dreamweaver and coding, so I think I'm just something wrong. I hope that someone will be able to point me in the right direction! Anyway, here's my problem...

    I could not get the Fancybox to work properly. When I test my page through Live View, it seems to work very well. However, Fancybox does not work as expected when I test through various browsers in preview. Instead of bring the image in a Fancybox object, it transfers me to a page that contains only the image. I've read several posts that have raised the same issue, but I can't simply solve this problem on my own.

    In order to understand this point, I created a simple test page that contains only the content of my Fancybox and a single image. I'll list the code below:

    <! doctype html >

    < html >

    < head >

    < meta charset = "UTF-8" >

    < title > FancyBox Test < /title >

    <! - load jquery - >

    " < script type =" text/javascript"src =" http://code.jQuery.com/jQuery-latest.min.js "> < / script > .

    <!--> fb style sheet

    "< link rel ="stylesheet"href="/fancybox/source/jquery.fancybox.css "type =" text/css"media ="screen"/ >

    <!-pack jquery fb->

    "< script type =" text/javascript"src="/fancybox/source/jquery.fancybox.pack.js "> < / script >

    < / head >

    < body >

    < a class = "fancybox" rel = "group1" href = "images/Illustration_1.png" > < img src = "images/Illustration_1.png" width = "620" class = "fancybox image" height = "662" / > < / a > "

    < script type = "text/javascript" >

    {$(document) .ready (function ()}

    $(".fancybox").fancybox ();

    });

    < /script >

    < / body >

    < / html >

    I kept all the Fancybox files in a folder called 'fancybox' in my root directory. I know that I do not need to place the image in a group, since I don't currently have more than one image, but finally, I would like to have multiple images, so I went ahead and assigned to a group. I added the class 'fancybox-image' to the image so that I was messing around and it seemed to make it work inside of Live View, but I does nothing for me when I use an excerpt.

    I tested in several browsers, but I tend to use Firefox to test the most. Using the Firefox web developer tools, I found some fundamental questions. The Console gives me the following error: "TypeError: $(...).» FancyBox is not a function"and the Style Editor told me that the style sheet can be loaded. I thought this might give me enough information to solve this problem on my own, but I'm obviously missing something here. Any help would be greatly appreciated!

    Is your folder fancybox on the same level of your images folder directory in your site definition?

    If so, just get rid of the bar oblique leader in your links to the fancybox scripts.

  • Audio in a timeline yet, but not the other?

    Hello

    I am trying to solve a problem in a timeline yet for Blu - ray with a MPEG2 and AC3 file.  It's weird because with the exact specifications of the same file for the video and audio, I'm able to hear the audio from the test project calendar (short term), but not the project calendar full length (about an hour and a half in duration).

    I'm burning a disk to verify that audio is just not there, rather than a problem reading with the project any longer, but can anyone suggest what may be broken here?  Again, the two projects seem to be identical in the parameters and specifications file for the video and audio, only the duration of a (work) is shorter than the other (does not).

    The audio file has been posted outside still like audio playback.

    Thank you for all what thoughts - what someone might have here.  BTW, the project has no menu screen.  That's a 'read only' Blu - ray disc

    Mtbakerstu

    That shows the status of transcoding of comics for each importing audio?

    Confirm that it is import and not dynamic link.

    How do you know that the file specifications are identical?

  • Code works on the new form not on the older form

    Hello

    I'm trying to modify an existing form (add the code). I tested the code in a new form, I have created on my computer but when I do the same thing on a form provided and created on another computer, the code does not work

    What I see is that the properties of the shape of a new form on my computer give Version 9. XXX and on the form that was created on another computer, the Version is listed as 8.XX

    Anyone know how I can convert Version 8. XX file Version 9.xx?

    Or does anyone know how to set up a group of EnclosedOption necessary in Version 8 as an option? "In the 9 version that I use Gender.validate.nullTest ="error"or Gender.validate.nullTest =" disabled "but it does not work on the older Version 8.xx PDF file.

    Help greatly appreciated!

    concerning

    Meir

    Reason for the difference in the behavior of the form is one static pdf where the other is dynamic pdf. The objects are drawn differently depending on how the form is saved and made.  When static red boxes will not appear when changed dynamically on the fly.  However, the feature does not work, it does not allow a shipment but is not as noticeable without the red border as to where to find the missing information.

    There was a tag http://www.xfa.org/schema/xfa-template/2.6/ LegacyEventModel:1 LegacyRendering:1? > when appropriate causes the form to behave differently.

  • How do I open the .snp with Microsoft Office 2007 files is installed? It works with MS Office 2003, but not with MS Office 2007!

    I have MS Office Pro Plus 2007 is installed on my computer. I also MS Office 2003 is installed on a different computer. Snapshot viewer is installed on both. My snapshot of work files works with MS Office Access 2003 but not recognized by MS Office Access 2007. It would allow me to save them either! Is this a problem with FireFox (3.6.8)? However, I have no problem, open them using IE7/8 on both computers. Any ideas? Thank you.

    I heard about other problems with Office 2007 to 2003, but most of the people do not have Pro/business versions with access, so maybe there's a previously unnoticed problem.

    As indicated in my previous post, I don't always understand how you try to access the file. Can you right click and "save link as" to download?

  • delete code works in R12 12.1.1 not in R12 12.1.3

    Hi all

    I have a code to remove lines if the cutsno is NULL (the region of isTable line custno, we have more lines)

    if ("delete1".equals(pageContext.getParameter(EVENT_PARAM)))
    {
      System.out.println("Delete Number1 :");
      pageContext.writeDiagnostics(this,"Delete Number1 :",OAFwkConstants.STATEMENT);
      String orderno = pageContext.getParameter("porderno");
      pageContext.writeDiagnostics(this,"Order Number :"+orderno,OAFwkConstants.STATEMENT);
      String pcustno = pageContext.getParameter("pcustno");
      pageContext.writeDiagnostics(this,"Customer No :"+pcustno,OAFwkConstants.STATEMENT);
      String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
      OARow row = (OARow) am.findRowByRef(rowReference);
      pageContext.writeDiagnostics(this,"Before Cust Null:",OAFwkConstants.STATEMENT);
      if ("".equals(pcustno))
      {
       pageContext.writeDiagnostics(this,"Entered Cust Null if :",OAFwkConstants.STATEMENT);
       row.remove();
       throw new OAException("Record is deleted Successfully", OAException.INFORMATION);
      }
     else
    {
            throw new OAException((new StringBuilder()).append("These Order number already exists");
     }
    

    JDeveloper 10.1.3.3.0

    1)R12-VISION Oracle Apps Instance > 12.1.1

    2) -> project Instance Oracle Apps R12 12.1.3



    The above code is working well in case of the Vision, but does not work in the instance of project

    Of the error

    (1) Error (757,59): field EVENT_ROW_SOURCE_PARAM not found in the Insert.oracle.apps.po.Insert.webui.InsertCO class

    (2) Error (758,22): incompatible types. found: class java.lang.Object, required: class java.lang.String on pcustno

    (3) Error (760,21): incompatible types. found: class java.lang.Object, required: class java.lang.String on orderno

    Get above error'r, while the added code in the CO please suggest

    Sorry, it was my mistake, use EVENT_SOURCE_ROW_REFERENCE. What you used below is correct.

    String rowReference = pageContext.getParameter (OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);

    Try this code:

    if ("delete1".equals(pageContext.getParameter(EVENT_PARAM)))
    {
    
      String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
      OARow row = (OARow) am.findRowByRef(rowReference);
      pageContext.writeDiagnostics(this,"row:" + row ,OAFwkConstants.EXCEPTION);
      String pcustno = row.getAttribute("itemcust");
      String orderno = row.getAttribute("orderno");
      System.out.println("order no:"+orderno);
      pageContext.writeDiagnostics(this,"pcustno :"+pcustno,OAFwkConstants.EXCEPTION);
      pageContext.writeDiagnostics(this,"orderno :"+orderno,OAFwkConstants.EXCEPTION);
    
      if ((pcustno == null) || (pcustno.trim().length() == 0))
      {
      pageContext.writeDiagnostics(this,"Inside If :",OAFwkConstants.EXCEPTION);
      row.remove();
      throw new OAException("Record is deleted Successfully", OAException.INFORMATION);
      }
      else
      {
      // Your additional check goes here.
      throw new OAException((new StringBuilder()).append("These Order number already exists");
      }
    

    Let me know if you don't understand all the lines in the code above.

    (2) 444--> it is not moved (N)

    I don't understand the logic.

    If you paste the complete code and debugging lines and explain your problem, it might be easy to help.

    If you have too many conditions, try to get a condition first, then add the second condition in the appropriate place.

    See you soon

    AJ

  • CSS position: fixed works on mozilla 21/IE10, but not in chrome?

    Hello guys,.

    I want to post a rectangle or a picture while scrolling browser.

    I use sym.$("Rectangle3").css ({'position':"fixed"});})

    It works fine in Mozilla and IE10 but not in chrome (Version 27.0.1453.116 m)

    Anyone help please?

    Thanks in advance.

    Anthony

    @2adps I think that the question boils down to translateZ (0) which is a known trick to force the GPU acceleration - and uses the same trick as animate

    I asked one of our developers and we have found a workaround.

    Add to the event compositionReady to the scene:

    $("body").append ($("#Stage_rect").css ("position", "fixed"));

    Replace "Stage_rect" what is your name of the element. For example, if your name of the element is "Rectangle3"level step in your items Panel, it becomes '#Stage_Rectangle3'. '. You can also get the name of this ID by the Inspector of your browser tools.

    Sarah

  • Help - links work in stand alone film, but not in html...

    Hi guys,.

    I have a huge problem. I have a menu in Flash MX (AS2), it's pretty simple: it's a list of links, but every time you hover over one of several related those highlight (the client really wanted it). The code on each button is:

    {run}
    gotoAndPlay (3);
    }

    {We (Release)}
    getURL ("http://festusobayiuwana.com/index.php?option=com_content & view = article & id = 17'");
    }

    {We (Rollout)}
    gotoAndPlay (1);
    }

    It works fine in IE8, it works fine in the preview in flash, but in FF/Chrome rolling works but the link is not clickable. Nothing happens when you click on. I thought maybe it was a record in question, but when I loaded the film in FF, but not embeded in html that it worked well, it is only when it is embedded in html that will not click on the links.

    The film is here , and the film in a plain html page is here.

    http://festusobayiuwana.com/images/Flash.htm

    There is no code that may be playing with her, because it's the only thing in the html code.

    Does anyone know why this problem might have occurred, please?

    Thank you

    Pete

    you have incomplete incorporation of code swf.

    have the flash publish your html file and use it.

Maybe you are looking for