TypeError: Error #1116: second argument to Function.prototype.apply must be an array

Hi Frnds
             I m loading an external swf into my swf using flex event.
          e.target.content.addEventListener(FlexEvent.APPLICATION_COMPLETE,centerSWFLoad);
but after this line it throws runtime 1116 error.please guide why this error occur and tell me which parameter i have to make array?
is it adobe frame work ecxeption or something else.kindly guide the solution.
TypeError: Error #1116: second argument to Function.prototype.apply must be an array.
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at mx.managers::CursorManagerImpl/marshalCursorManagerHandler()[C:\autobuild\3.2.0\framework s\projects\framework\src\mx\managers\CursorManagerImpl.as:980]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.managers::CursorManagerImpl/registerToUseBusyCursor()
    at mx.managers::CursorManager$/http://www.adobe.com/2006/flex/mx/internal::registerToUseBusyCursor()
    at mx.controls::SWFLoader/set showBusyCursor()
    at mx.core::Container/createComponentFromDescriptor()
    at mx.core::Container/createComponentsFromDescriptors()
    at mx.core::Container/createChildren()
    at mx.core::UIComponent/initialize()
    at mx.core::Container/initialize()
    at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()
    at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::childAdded()
    at mx.core::Container/addChildAt()
    at mx.core::Container/addChild()
    at mx.c
    at mx.core::UIComponent/initialize()
    at mx.core::Container/initialize()
    at mx.core::Application/initialize()
    at centerswf/initialize()
    at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::childAdded()
    at mx.managers::SystemManager/initializeTopLevelWindow()
    at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()
    at mx.managers::SystemManager/docFrameListener()
Thanks in advance
    Vineet Osho

Thanks sir  for your response.i am using flex builder three for both my application and swf that i load at runtime through swfloader.
i also go through the marshling problem forum and your reply in that forum.but couldnot find the solution.
can you please explain me what is the problem in my case and how to resolve that.the release build of my application is running perfect on some system but some time shows problem.

Similar Messages

  • AIR 3.7 Beta: TypeError: Error #2022 occurs for an unrelated class

    On AIR SDK 3.7.0.1240, the error "TypeError: Error #2022: Class (flash.text.Font-derived class) must inherit from DisplayObject to link to a symbol" occurs when instantiating an unrelated class when launched in the Flash Builder debugger.
    Include an swc with a linkage built with Flash Pro and instantiate a class (ClassA) in the swc results in:
    TypeError: Error #2022: ClassB must inherit from DisplayObject to link to a symbol.
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at ClassA()
    Does anyone see this? Because of this problem, I can't evaluate AIR 3.7 Beta at all.
    I entered the bug here.
    https://bugbase.adobe.com/index.cfm?event=bug&id=3520793

    no, i try to install air app on desktop that was build month ago, and was succefully installed previously
    but now, said that there is a problem, and i need to send request to this app developer (me)
    problem was with certification, it was expired, generate new one, compile app, and it installed
    sry for bad english

  • More "TypeError: Error #1006: value is not a function." trouble

    var pntClk:int = -1;
    for(var t:int=0;t<tab1PointsArray.length;t++) {
         tab1PointsArray[t].addEventListener(MouseEvent.CLICK, tab1PointClicked); <Problem code i think. Error points to line 117
         trace("Event listener added to " + tab1PointsArray[t].name);
    function tab1PointClicked (event:MouseEvent):void {
         for(var T:int=0;T< tab1PointsArray.length;T++) {
              if (event.currentTarget == tab1PointsArray[T]) {
                   pntClk = T;
                   openInfoTab();
                   trace("Point Clicked: " +  tab1PointsArray[T].name);
    I wrote some previous code that worked and i copy pasted over to this project and it doesn't work.
    The weird part to me is that it still runs the first set of trace statements (there are 8 objects in that array). But, it won't run the second set...
    for(var l:int=0;l<Tab2PointsArray.length;l++) {
         Tab2PointsArray[l].addEventListener(MouseEvent.CLICK, tab2PointClicked);
         trace("Event listener added to " + Tab2PointsArray[l].name);
    function tab2PointClicked (event:MouseEvent):void {
         for(var t:int=0;t< Tab2PointsArray.length;t++) {
              if (event.currentTarget ==  Tab2PointsArray[t]) {
                   pntClk = t;
                   openInfoTab();
                   trace("Point Clicked: " +  Tab2PointsArray[t].name);
    if you need more code or info to help me figure this out let me know
    I don't know actionscript that well so bare with

    The output window:
    Event listener added to PointHitch
    Event listener added to PointPTO
    Event listener added to PointSafety
    Event listener added to PointGearBox
    Event listener added to PointBlade
    Event listener added to PointTeeth
    Event listener added to PointGrapple
    TypeError: Error #1006: value is not a function.
    at TractorSawFlash_fla::MainTimeline/frame1()[TractorSawFlash_fla.MainTimeline::frame1:115]
    I think the first set of listeners is added then the error happens and the second set of listeners doesn't get added.
    Here is more code.
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import flash.events.MouseEvent;
    var infoTabIsOpen:Boolean = false;
    //TAB CODE
    var TractorSawTabToggle:Boolean = false;
    var TabButtonArray:Array = new Array(TabTR3200.TR3200BTN, TabTR3200LT.TR3200BTNLT);
    for (var i:int=0; i<TabButtonArray.length; i++)
         TabButtonArray[i].id = i;
         TabButtonArray[i].addEventListener(MouseEvent.CLICK, onClick);
    TabTR3200.TR3200BTN.mouseEnabled = false;
    TabTR3200.TR3200BTN.buttonMode = false;
    function onClick(event:MouseEvent):void{
         if (TractorSawTabToggle == true) {
              TractorSawTabToggle = false;
              swapChildren(this.TabTR3200,this.TabTR3200LT);
              TabTR3200LT.TR3200BTNLT.mouseEnabled = true;
              TabTR3200LT.TR3200BTNLT.buttonMode = true;
              TabTR3200.TR3200BTN.mouseEnabled = false;
              TabTR3200.TR3200BTN.buttonMode = false;
         else {
              TractorSawTabToggle = true;
              swapChildren(this.TabTR3200,this.TabTR3200LT);
              TabTR3200LT.TR3200BTNLT.mouseEnabled = false;
              TabTR3200LT.TR3200BTNLT.buttonMode = false;
              TabTR3200.TR3200BTN.mouseEnabled = true;
              TabTR3200.TR3200BTN.buttonMode = true;
    //END TAB CODE
    //MovieTab
    MovieButton.addEventListener(MouseEvent.CLICK, clickedMainMovie);
    MovieTab.Exit_BTN.addEventListener(MouseEvent.MOUSE_DOWN, outMainMovieTrigger);
    function clickedMainMovie(event:MouseEvent):void {
         var TabMainMovieDown:Tween = new Tween(MovieTab, "y", Strong.easeOut, -600, 0, 1, true);
         var TabMainMovieAlphaIn:Tween = new Tween(MovieTab, "alpha", Strong.easeOut, 0, 1, 1, true);
         if (infoTabIsOpen == true) {
              closeInfoTab();
    function outMainMovieTrigger(event:MouseEvent):void {
         outMainMovie();
    function outMainMovie():void {
         trace("Three Sixty MOUSE_OUT");
         var TabMainMovieUp:Tween = new Tween(MovieTab, "y", Strong.easeOut, 0, -600, 1, true);
         var TabMainMovieAlphaOut:Tween = new Tween(MovieTab, "alpha", Strong.easeOut, 1, 0, 1, true);
         MovieTab.FLVPlayback.stop();
    //END MovieTab
    //INFO TAB ARRAYS AND FUNCTIONS
    var placeHolder:String = "null";
    var tab1PointsArray:Array = new Array(this.TabTR3200.PointHitch, //0
                                                             this.TabTR3200.PointPTO, //1
                                                             this.TabTR3200.PointSafety, //2
                                                             this.TabTR3200.PointGearBox, //3
                                                             this.TabTR3200.PointBlade, //4
                                                             this.TabTR3200.PointTeeth, //5
                                                             this.TabTR3200.PointGrapple, //6
                                                             placeHolder); //7
    var Tab2PointsArray:Array = new Array(this.TabTR3200LT.PointHitch, //0
                                                              this.TabTR3200LT.PointPTO, //1
                                                              this.TabTR3200LT.PointSafety, //2
                                                              this.TabTR3200LT.PointGearBox, //3
                                                              this.TabTR3200LT.PointBlade, //4
                                                              this.TabTR3200LT.PointTeeth, //5
                                                              placeHolder, //6
                                                              this.TabTR3200LT.PointPushingBar);//7
    var pictureArray:Array = new Array(placeHolder,
                                                       placeHolder,
                                                       placeHolder,
                                                       placeHolder,
                                                       placeHolder,
                                                       placeHolder,
                                                       placeHolder,
                                                       placeHolder);
    var textArray:Array = new Array(InfoTab.txtHitch, //0
                                                   InfoTab.txtPTO, //1
                                                   InfoTab.txtSafety, //2
                                                   InfoTab.txtGearbox, //3
                                                   InfoTab.txtBlade, //4
                                                   InfoTab.txtTeeth, //5
                                                   InfoTab.txtGrapple, //6
                                                   InfoTab.txtPushingBar); //7
    //Point Clicked Code
    var pntClk:int = -1;
    for(var t:int=0;t<tab1PointsArray.length;t++) {
         tab1PointsArray[t].addEventListener(MouseEvent.CLICK, tab1PointClicked); <LINE 115 were it says the error is happening
         trace("Event listener added to " + tab1PointsArray[t].name);
    function tab1PointClicked (event:MouseEvent):void {
         for(var T:int=0;T< tab1PointsArray.length;T++) {
              if (event.currentTarget == tab1PointsArray[T]) {
                   pntClk = T;
                   openInfoTab();
                   trace("Point Clicked: " +  tab1PointsArray[T].name);
    for(var l:int=0;l<Tab2PointsArray.length;l++) {
         Tab2PointsArray[l].addEventListener(MouseEvent.CLICK, tab2PointClicked);
         trace("Event listener added to " + Tab2PointsArray[l].name);
    function tab2PointClicked (event:MouseEvent):void {
         for(var t:int=0;t< Tab2PointsArray.length;t++) {
              if (event.currentTarget ==  Tab2PointsArray[t]) {
                   pntClk = t;
                   openInfoTab();
                   trace("Point Clicked: " +  Tab2PointsArray[t].name);
    //Info Tab
    var ImageLoader:Loader;
    ImageLoader = new Loader();
    // make text invisible
    function makeTextInvisible():void {
         for (var txt:int=0; txt<textArray.length; txt++) {
              textArray[txt].visible = false;
    InfoTab.Exit_BTN.buttonMode = true;
    InfoTab.Exit_BTN.addEventListener(MouseEvent.CLICK, closeInfoTrigger);
    function closeInfoTrigger(e:MouseEvent):void {
         trace("close feature triggered");
         closeInfoTab();
    //OPEN INFO TAB
    function openInfoTab():void {
         //EnableExitButton
         var EnableExitButton:Timer = new Timer(333, 1);
         InfoTab.mouseEnabled = true;
         InfoTab.mouseChildren = true;
         var tabIn:Tween = new Tween(InfoTab, "y", Regular.easeOut, 600, 60, 10, false);
         var tabAlphaIn:Tween = new Tween(InfoTab, "alpha", Regular.easeOut, 0, 1, 10, false);
         //pictureSetter
         if (pictureArray[pntClk] != "null") {
              ImageLoader.load(new URLRequest(pictureArray[pntClk]));
              this.InfoTab.ImageHolder_MC.addChild(ImageLoader);
         textArray[pntClk].visible = true;
         infoTabIsOpen = true;
    //end open info tab
    //CLOSE INFO TAB
    function closeInfoTab():void{
         //deactivating setters
         InfoTab.mouseEnabled = false;
         InfoTab.mouseChildren = false;
         trace("feature tab deactivated");
         //unload picture
         if (pictureArray[pntClk] != "null") {
              ImageLoader.unload();
              this.InfoTab.ImageHolder_MC.removeChild(ImageLoader);
              ImageLoader = null;
         //tab action variables
         var tabAlphaOut:Tween = new Tween(InfoTab, "alpha", Regular.easeIn, 1, 0, 8, false);
         var tabOut:Tween = new Tween(InfoTab, "y", Regular.easeIn, 60, 600, 8, false);
         infoTabIsOpen = false;
         //exit timer
         var exitTimer:Timer = new Timer(200, 1);
         exitTimer.addEventListener(TimerEvent.TIMER, exitHandler);
         exitTimer.start();
         function exitHandler(event:TimerEvent):void
              trace("exit handler fired");
              makeTextInvisible();
         //end exit timer
         pntClk = -1;
    //end closeFeatureTab

  • CS3, MFC70.dll is missing JS Error - AQW.js, TypeError:AdvancedQueryWizard.preload is not a function

    Hi guys,
    BE SURE TO READ THE UPDATE BELOW....
    I have searched both Google and the Forums, but cannot find anything on this one.  Here is the history and both errors:
    Recently upgraded to new machines with an upgrade to Windows 7 from XP prof.  I personally installed the CS3 (web premium, upgraded from previous version) and all went well.  The only change was that I did not install all of the previous versions of Dreamweaver, like I had on my old PC.  I opened DW, pulled in all of my websites from the backup (work as a web developer/graphics designer) and all worked fine.
    I left for Christmas vacation, remoted in a few times, so I know my laptop was fine, never lost power, etc., but never did have to open DW during that time.
    Got back this week, had to make a change to a page that contains the XMLFlashSlideshow (v3).  Opened Dreamweaver and got the first of two errors: "MFC70.DLL is Missing"  The message indicated a reinstall would take care of the problem.  I clicked ok, and then I got this error message:
    While executing onLoad in AQWLoad.htm, the following JavaScript error(s) occured:
    At line 60 of file "C:/Program Files (x86)\Adobe\Adobe Dreamweaver CS3\Configuration\Startup\..\Shared\AQW\AQW.js": TypeError:AdvancedQueryWizard.preload is not a function
    When I clicked OK, the message appeared again immediately.  I clicked ok again, and Dreamweaver began to open.
    I figured I could make the change and troubleshoot after, but when I went in, I could not longer see the box I normally see to click on to edit for the slideshow.  These error messages occur every time I open Dreamweaver, even after a reinstall.  I did not have this page, nor even this site as the default when first opening DW when the errors first occurred.
    UPDATE:  These errors do not seem to occur the first time Dreamweaver is run, be do occur each time afterwards.
    I have also noticed that I cannot print from Word 2007 to the Adobe printer driver as I always have.  Not sure if that is related or not.
    Any ideas, anyone else run into this?
    Thanks for anything help you can send my way.
    Thanks,
    Suzanne

    For the JS error: http://kb2.adobe.com/cps/405/kb405604.html
    If mfc70.dll is really missing, that is a core Windows file.  If you need to fix that you need to have your Windows 7 disc ready and run "sfc /scannow" in the command prompt.  You may need your Windows 7 if the file cannot be repaired and has to be restored.  This can affect all aspects of your system and not just Dreamweaver if there is really a problem there. 
    The Word -> Adobe Printer is another issue.  You may want to post that in the Acrobat forums along with the version of Acrobat Professional you are using.

  • TypeError: Error #1006: getInstance is not a function.

    I having some problems implementing Flex for the first time.
    At the moment I'm getting
    TypeError: Error #1006: getInstance is not a function.
    I suspect that I'm missing a library or something in the
    compile but I don't know how to resolve it.
    When I Run the Application in Flex Builder I get an error
    that the file isn't in the project and that some of the features
    are disabled. This would be consistent with an incomplete compile
    but the file is in a project. I even recreated a new project but I
    get the same errors.
    What am I missing?

    More detail on the error:
    TypeError: Error #1006: getInstance is not a function.
    at mx.core::Singleton$/getInstance()
    at mx.styles::StyleManager$cinit()
    at global$init()
    at mx.containers::Form$cinit()
    at global$init()
    at global$init()
    In debug it was stopping here in Singleton.as
    public static function getInstance(name:String):Object
    var clazz:Class = classMap[name];
    return Object(clazz).getInstance();
    I changed the container from mx:Form to mx:Application so now
    it seems to be working, but I'm not sure why mx:Form was giving me
    this issue.

  • Run time error: Incompatible argument to function

    I user JDeveloper 9.0.3.2, JDK 1.4.1_02, deployed to stand alone OC4J 9.0.3.0.0
    when I run my client, get the following error:
    java.lang.VerifyError: (class: com/ses/nucleus/bc4j/base/BaseViewObjectImpl, method: getMaxMinValue signature: (II)Ljava/lang/Object;) Incompatible argument to function
    any suggestions?
    Thanks a lot in advance!
    Frank
         

    does the problem persist if you use JDK 1.3 for running your OC4J 9.0.3 container?

  • Voting poll using PHP & MySQL TypeError: Error #2007: Parameter text must be non-null.

    I am getting this back:
    TypeError: Error #2007: Parameter text must be non-null.
    at flash.text::TextField/set text()
    at AS3_Flash_Poll_PHP_MySQL_fla::WholePoll_1/completeHandler()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    PHP code:
    <?php
    // ---------------------------------------- Section 1 -----------------------------------------------
    //  IMPORTANT!!!! Connect to MySQL database here(put your connection data here)
    mysql_connect("ginaty05.fatcowmysql.com","fall2010","@regina") or die (mysql_error());
    mysql_select_db("poll_2010") or die (mysql_error());
    // When Flash requests the totals initially we run this code
    if ($_POST['myRequest'] == "load_numbers") {
    // Query the totals from the database
        $sql1 = mysql_query("SELECT id FROM votingPoll WHERE choice='1'");
        $choice1Count = mysql_num_rows($sql1);
        $sql2 = mysql_query("SELECT id FROM votingPoll WHERE choice='2'");
        $choice2Count = mysql_num_rows($sql2);
        $sql3 = mysql_query("SELECT id FROM votingPoll WHERE choice='3'");
        $choice3Count = mysql_num_rows($sql3);
        echo "choice1Count=$choice1Count";
        echo "&choice2Count=$choice2Count";
        echo "&choice3Count=$choice3Count";
    // ---------------------------------------- Section 2 -----------------------------------------------
    // IF POSTING A USER'S CHOICE
    if ($_POST['myRequest'] == "store_choice") {
        //Obtain user IP address
        $ip = $_SERVER['REMOTE_ADDR'];
        // Create local variable from the Flash ActionScript posted variable
        $userChoice = $_POST['userChoice'];
        $sql = mysql_query("SELECT id FROM votingPoll WHERE ipaddress='$ip'");
        $rowCount = mysql_num_rows($sql);
        if ($rowCount == 1) {
    $my_msg = "You have already voted in this poll.";
    print "return_msg=$my_msg";
        } else {
    $sql_insert = mysql_query("INSERT INTO votingPoll (choice, ipaddress) VALUES('$userChoice','$ip')")  or die (mysql_error());
    $sql1 = mysql_query("SELECT * FROM votingPoll WHERE choice='1'");
    $choice1Count = mysql_num_rows($sql1);
    $sql2 = mysql_query("SELECT * FROM votingPoll WHERE choice='2'");
    $choice2Count = mysql_num_rows($sql2);
    $sql3 = mysql_query("SELECT * FROM votingPoll WHERE choice='3'");
    $choice3Count = mysql_num_rows($sql3);
    $my_msg = "Thanks for voting!";
            echo "return_msg=$my_msg";
            echo "&choice1Count=$choice1Count";
    echo "&choice2Count=$choice2Count";
    echo "&choice3Count=$choice3Count";
    ?>
    AS3 code:
    stop(); // Stop the timeline since it does not need to travel for this to run
    // Assign a variable name for our URLVariables object
    var variables1:URLVariables = new URLVariables();
    //  Build the varSend variable
    var varSend1:URLRequest = new URLRequest("parse_my_poll.php");
    varSend1.method = URLRequestMethod.POST;
    varSend1.data = variables1;
    // Build the varLoader variable
    var varLoader1:URLLoader = new URLLoader;
    varLoader1.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader1.addEventListener(Event.COMPLETE, completeHandler1);
    // Set variable to send to PHP here for the varloader below
    variables1.myRequest = "load_numbers";  
    // Send data to php file now, and wait for response using the COMPLETE event
    varLoader1.load(varSend1);
    function completeHandler1(event:Event):void{
        count1_txt.text = "" + event.target.data.choice1Count;
        count2_txt.text = "" + event.target.data.choice2Count;
        count3_txt.text = "" + event.target.data.choice3Count;
    // hide the little processing movieclip
    processing_mc.visible = false;
    // Initialize the choiceNum variable that we will use below
    var choiceNum:Number = 0;
    // Set text formatting colors for errors and success messages
    var errorsFormat:TextFormat = new TextFormat();
    errorsFormat.color = 0xFF0000; // bright red
    var successFormat:TextFormat = new TextFormat();
    successFormat.color = 0x00FF00; // bright green
    // Button Click Functions
    function btn1Click(event:MouseEvent):void{
        choiceNum = 1;
        choice_txt.text = choice1_txt.text;
    function btn2Click(event:MouseEvent):void{
        choiceNum = 2;
        choice_txt.text = choice2_txt.text;
    function btn3Click(event:MouseEvent):void{
        choiceNum = 3;
        choice_txt.text = choice3_txt.text;
    // Button Click Listeners
    btn1.addEventListener(MouseEvent.CLICK, btn1Click);
    btn2.addEventListener(MouseEvent.CLICK, btn2Click);
    btn3.addEventListener(MouseEvent.CLICK, btn3Click);
    // Assign a variable name for our URLVariables object
    var variables:URLVariables = new URLVariables();
    //  Build the varSend variable
    var varSend:URLRequest = new URLRequest("parse_my_poll.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    // Build the varLoader variable
    var varLoader:URLLoader = new URLLoader;
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);
    // Handler for PHP script completion and return
    function completeHandler(event:Event):void{
        // remove processing movieclip
        processing_mc.visible = false;
        // Clear the form fields
        choice_txt.text = "";
        choiceNum = 0;
        // Load the response from the PHP file
        status_txt.text = event.target.data.return_msg;
        status_txt.setTextFormat(errorsFormat);
        if (event.target.data.return_msg == "Thanks for voting!") {
            // Reload new values into the count texts only if we get a proper response and new values
            status_txt.setTextFormat(successFormat);
            count1_txt.text = "" + event.target.data.choice1Count;
            count2_txt.text = "" + event.target.data.choice2Count;
            count3_txt.text = "" + event.target.data.choice3Count;
    // Add an event listener for the submit button and what function to run
    vote_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
    // Validate form fields and send the variables when submit button is clicked
    function ValidateAndSend(event:MouseEvent):void {
        //validate form fields
        if(!choice_txt.length) {  
            // if they forgot to choose before pressing the vote button
            status_txt.text = "Please choose before you press vote.";  
            status_txt.setTextFormat(errorsFormat);
        } else {
            status_txt.text = "Sending...";
            processing_mc.visible = true;
            // Ready the variables for sending
            variables.userChoice = choiceNum;
            variables.myRequest = "store_choice";  
            // Send the data to the php file
            varLoader.load(varSend);
        } // close else after form validation
    } // Close ValidateAndSend function ////////////////////////

    This error means that you are trying to set the text field but there is no data in the variable. As a first step, try to identify where this is happening, eg Is it the first call, or once you have submitted your data or only if you try to submit data second time?
    Trace out the data that is returned for both completeHandlers to see if there is a missing var. Try this for "load_numbers" and "store_choice". Do it twice for "store_choice". Do you get back what you expected?
    You could also try altering the php to return some fixed dummy variables, eg  choice1Count=11&choice2Count=22&choice3Count=33, etc. If this works then you know that the error is in the PHP.
    It looks to me like the issue is when you submit the data a second time and just get back the return_msg - the handler then tries to assign the choice1Count etc but doesn't have any count data back from the poll.php.
    Test that there is data before assigning it, eg
        if(event.target.data.choice1Count){
            count1_txt.text =  event.target.data.choice1Count;
            count2_txt.text =  event.target.data.choice2Count;
            count3_txt.text =  event.target.data.choice3Count;

  • TypeError: Error #1006 - Removing MovieClip from the stage

    I have a movie clip that is called to the stage and once the movieclip is finished it calls a function that removes it from the stage. The code works but I get an error message about 4 seconds after the movie clip ends.
    Here’s the error message:
    TypeError: Error #1006: exitWordMicroscopic is not a function.
                    at ASvocabulary_microscopic/frame110()[ASvocabulary_microscopic::frame110:1]
    Here’s the stage code:
    //************************Removes the movieclip from the stage and enables the button.*************************
    function exitWordMicroscopic():void
                    bnt_vocab_microscopic.mouseEnabled = true;
                    removeChild(word_Microscopic);
    //******************************Stage buttons**************************************
    stage.addEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
    function goButtonsHomeRead_1(event:MouseEvent):void
                    //Vocabulary buttons
                    if (event.target == bnt_vocab_microscopic)
                                    bnt_vocab_microscopic.mouseEnabled = false;
                                    SoundMixer.stopAll();
                                    addChild(word_Microscopic);
                                    word_Microscopic.x = 47;
                                    word_Microscopic.y = 120;
    Here’s the code inside the movie clip. This is what the error message is referring to:
    //****************** Calls function to remove itself from the stage****************************
    Object(parent).exitWordMicroscopic();
    What am I doing wrong?

    Here' how the code looks now:
    Objective: To remove the current movieclip while it's playing so that it does not show on the next (or previous) frame.
    Here’s the stage code:
    var word_Microscopic:ASvocabulary_microscopic = new ASvocabulary_microscopic();
    //Removes the movieclip from the stage and enables the button.
    function exitWordMicroscopic():void
        bnt_vocab_microscopic.mouseEnabled = true;
        removeChild(word_Microscopic);
    //******************************Stage buttons**************************************
    stage.addEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
    function goButtonsHomeRead_1(event:MouseEvent):void
        //Vocabulary buttons
        if (event.target == bnt_vocab_microscopic)
            SoundMixer.stopAll();
            bnt_vocab_microscopic.mouseEnabled = false;
            addChild(word_Microscopic);
            word_Microscopic.x = 47;
            word_Microscopic.y = 120;
            word_Microscopic.play();
    //This button takes the user to the Main Screen
        if (event.target == bnt_ReadGoHome_1)
           // exitWordMicroscopic(); [If I use this function I get this error ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.]
            SoundMixer.stopAll();
            gotoAndPlay("1","Main");
            stage.removeEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
    //This takes the user to the next frame.
    if (event.target == GoNext_1)
            SoundMixer.stopAll();
            gotoAndPlay("2");
            stage.removeEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
    Here’s the code inside the movie clip.
    //****************** Calls function to remove itself from the stage****************************
    Object(parent).exitWordMicroscopic();

  • Function.prototype

    Hey all, I come from an ajax environment and have been using
    Prototype.js library for quite some time.
    I'm attempting to recreate some of the features by extending
    the core Function object, however I am not having much luck. Has
    anyone done this with Flex yet? Here's a snippet of what I'm
    attempting:
    Function.prototype.bind = function():* {
    var __method:Object = this, args:Array = arguments,
    object:Object = args.shift();
    return function():* {
    return __method.apply(object, args.concat(arguments));
    var tmp:Function = function():void {
    Then when doing something like:
    Alert.show(tmp.bind(null));
    I get the error (in Flex Builder 2):
    1061: Call to a possibly undefined method bind through a
    reference with static type Function.
    Anyone have any idea on how to do what I'm trying?
    Thanks!

    I think I get his question...
    He wants to make a C call which returns a pointer to Y[] in the form Y=HandleByVI(&input,len,&charbuff[0], i...).
    The labview define VI Prototype window doesn't allow pointers to be returned, only output values. which may be selected in the VI output dropbox.
    What you really want is status=HandleByVI (double* input, double*output, long len, char* s...) and let status = success or failure of the function.
    Wire up your inputs and outputs to the icon as you would for any subvi and they will be available when you select the Export VIs in the builder.
    Cheers!
    David
    Ain't English just wunderful!

  • TypeError: Error #1034 - Want to display a swf

    Hi,
    I´m new to AS3 and try to load/display swf´s on the stage. The swf´s should run and if the user clicks a button the next swf should be displayed.
    That works so far if I use some swf´s that are created also with FlashPlayer 9 and AS3. But if I use a swf created by someone else I get a TypeError: Error #1034. So far, I have no idea why this happens. Maybe you can have a look at my code and give me a hint. Thanks in advance.
    var configfile = "test.xml";
    var xml_url:String = configfile;
    var urlLoader:URLLoader = new URLLoader();
    urlLoader.addEventListener(Event.COMPLETE, setClips);
    var xml:XML;
    var currentClip:int = 0;
    var clips:Array = new Array(); btnPrevious.addEventListener(MouseEvent.CLICK, previousClip);
    setChildIndex(btnPrevious,1);
    btnNext.addEventListener(MouseEvent.CLICK, nextClip);    
    setChildIndex(btnNext,1);
    function setClips(e:Event) {
        this.xml = new XML(e.target.data);
        this.playClip(this.currentClip);
    function playClip(index:Number) {              
        if (!this.clips[index]) {           
            var request:URLRequest = new URLRequest(this.xml.item[index]);           
            var loader:Loader = new Loader();
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.setMovieClip);    
            loader.load(request);
        else {
            this.currentClip = index;              
         this.clips[this.currentClip].play();    
            this.addChild(this.clips[this.currentClip]);
            setChildIndex(this.clips[this.currentClip],0);              
            this.clips[this.currentClip].addEventListener(Event.ENTER_FRAME, this.onEnterFrameCheck);
    function nextClip(e:MouseEvent) {
         this.clips[this.currentClip].gotoAndStop(0);
            this.removeChild(this.clips[this.currentClip]);
         this.currentClip = this.currentClip + 1;    
         if(this.currentClip == this.xml.item.length()) {
              this.currentClip = 0;
         this.playClip(this.currentClip);    
    function previousClip(e:MouseEvent) {
        this.clips[this.currentClip].gotoAndStop(0);
        this.removeChild(this.clips[this.currentClip]);
        this.currentClip = this.currentClip - 1;
        if(this.currentClip == -1) {
           this.currentClip = this.xml.item.length() - 1;    }         this.playClip(this.currentClip);    
    function setMovieClip(e:Event):void {    this.clips[this.currentClip] = MovieClip(e.target.loader.content);
        this.addChild(this.clips[this.currentClip]);
        setChildIndex(this.clips[this.currentClip],0);  
        this.clips[this.currentClip].addEventListener(Event.ENTER_FRAME, this.onEnterFrameCheck);
    function onEnterFrameCheck(e:Event):void {
        if(this.clips[this.currentClip] && this.clips[this.currentClip].currentFrame == this.clips[this.currentClip].totalFrames) {
            this.clips[this.currentClip].gotoAndStop(0);    
            this.clips[this.currentClip].removeEventListener(Event.ENTER_FRAME, this.onEnterFrameCheck);         
            this.removeChild(this.clips[this.currentClip]);    
            if(this.currentClip >= this.xml.item.length()-1) {
                 this.currentClip = -1;
         }                               this.currentClip++;              
            this.playClip(this.currentClip);
    urlLoader.load(new URLRequest(this.xml_url)); 
    stop();
    And here The XML:
    <banners>
    <item>banner1.swf</item>
    <item>banner2.swf</item>
    <item>banner3.swf</item>
    </banners>
    The full Error Message (In German:)
    TypeError: Error #1034: Typumwandlung fehlgeschlagen: flash.display::AVM1Movie@34d4df9 kann nicht in flash.display.MovieClip umgewandelt werden.
        at teaser_fla::MainTimeline/setMovieClip()

    The problem will be related to trying to manipulate an AS1/AS2 file using AS3... it cannot be done.  In this case, you are probably just seeing the first of a few errors where you try to manipulate an AS2 object by trying to cast it as an AS3 MovieClip object.  You would run into problems later when you try controlling/reading that same file (currentFrame is not an AS1/AS2 property, but you attempt to extract it).
    Per the Flash Help documentation...
    "ActionScript 3.0 code can load a SWF file written in ActionScript 1.0 or 2.0, but it cannot access the SWF file's variables and functions. "
    You can implement the LocalConnection class to overcome some of the issues, but if you are using other people's files, you are likely to hit a wall...
    "LocalConnection objects created in ActionScript 3.0 can communicate with LocalConnection objects created in ActionScript 1.0 or 2.0.
    The reverse is also true: LocalConnection objects created in ActionScript 1.0 or 2.0 can communicate with LocalConnection objects created in ActionScript 3.0. Flash Player handles this communication between LocalConnection objects of different versions automatically."

  • Another TypeError: Error #1009 Problem

    Hey all,   I've searched the 'net and searched these forums but can't seem to figure out what I'm doing wrong.  I'm creating a flash based game for school that so far has ten frames on the timeline.  I have buttons on frame one, frame 5, and frame 10. I have actionscript code to control those buttons on frame 1, frame 5, and frame 10 respectively.  The code is worded identically on each frame with the exception that I've changed the button names and the function names that are called when the mouse button is pressed.   The code works fine on frame 1 and on frame 5, but when I click the button on frame 5 that sends me to frame 10, I get this error immediately:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at keys2BibleTest_fla::MainTimeline/frame10()
        at flash.display::MovieClip/gotoAndStop()
        at keys2BibleTest_fla::MainTimeline/stormBtnHandler1()
    I have verified that each instance of the buttons do indeed have the name of the button being listened for in the event handlers. I can change the type from button to movieclip and it works fine.  I can also remove frames 1 through 9 and the code works.
    Here's the code:
    Frame 1:
    stop();
    enterBtn.addEventListener(MouseEvent.MOUSE_DOWN, enterBtnHandler1);
    function enterBtnHandler1(event:MouseEvent):void {
        gotoAndStop(5, "Scene 1");
    Frame 5:
    import flash.events.MouseEvent;
    stormBtn.addEventListener(MouseEvent.MOUSE_DOWN, stormBtnHandler1);
    function stormBtnHandler1(event:MouseEvent):void {
        gotoAndStop(10, "Scene 1");
    chickenOutBtn.addEventListener(MouseEvent.MOUSE_DOWN, chickenOutBtnHandler1);
    function chickenOutBtnHandler1(event:MouseEvent):void {
        gotoAndStop(1, "Scene 1");
    Frame 10:
    import flash.events.MouseEvent;
    creationBtn.addEventListener(MouseEvent.MOUSE_DOWN, creation);
    function creation(event:MouseEvent):void {
        gotoAndStop(3, "Scene 1");
    lifeBtn.addEventListener(MouseEvent.MOUSE_DOWN, lifeOfChrist);
    function lifeOfChrist(event:MouseEvent):void {
        navigateToURL(new URLRequest("http://www.ceoutreach.org"));
    I can't for the life of me figure out what's wrong.  Can anyone help?
    Thank you,
    Mike

    Ned,
    thank you for your reply. Unfortunately, my buttons are on separate layers and separated by blank keyframes to boot.  When I posted originally, the buttons were all on the same layer BUT separated by blank keyframes. After doing some research on the web, I moved the buttons to their own separate layers (one button per layer) and kept the blank keyframes as well.
    Currently, my only filled keyframes are one, five, and ten. All other keyframes are blank except for my labels and actionscript code. I'm using separate layers for labels and actions, too. I attempted to attach the file with my original post but received the message that .fla files are not allowed.  I don't know about your window, but mine says Max size 5.0 MB (my file is 2), All files types allowed except.... .fla is not one of those in the exception list so I expected it to go.
    It's got something to do with the two buttons on frame 10.... I just went into the actionscript and bypassed frame 5, going directly to frame 10 when the Enter button is depressed, and got the same error message.   There's something in the code I'm just not seeing.... when I comment out the code for the buttons, no error message.  Put the code back in, error message comes back.  Delete the buttons and the code and insert new ones, the error message comes back.
    It's got me totally stumped.
    Thank you for trying,
    Mike
    Edit: I forgot to mention, frame ten is the only place on the timeline where instances of these particular buttons are being used. The other frames are populated with different buttons.  Also, when I change the type to movieclip, everything works.  Weird, huh?

  • TypeError: Error #1007:Tried to create an instance in a no constructor

    Hello guys,
    Im stuck with actionscript error, i really need help here the error i got:-
    TypeError: Error #1007:Tried to create an instance in a no constructor.
    at Away3dScene/initObjects()
        at Away3dScene/init()
        at flash.display::DisplayObjectContainer/addChild()
        at Away3dProject()
    So use Away3d, however dont know really where is the error becouse every thing seems be okay, im using adobe flash cs5.5, flash player 10.
    main.as code:
    package
        import flash.display.Sprite;
        import flash.display.StageScaleMode;
        import flash.display.StageAlign;
        import net.hires.utils.Stats;
        public class Away3dProject extends Sprite
            public function Away3dProject()
                stage.scaleMode =  StageScaleMode.NO_SCALE;
                stage.align =  StageAlign.TOP_LEFT;
                var scene:Away3dScene = new Away3dScene();
                addChild(scene);
                var stats:Stats = new Stats();
                addChild(stats);
         and here Away3dscene.as:
    package
        import away3d.cameras.Camera3D;
        import away3d.containers.Scene3D;
        import away3d.containers.View3D;
        import away3d.core.base.Object3D;
        import away3d.core.clip.RectangleClipping;
        import away3d.core.math.Number3D;
        import away3d.materials.WireColorMaterial;
        import away3d.overlays.LensFlare;
        import away3d.primitives.Plane;
        import flash.display.BlendMode;
        import flash.display.Sprite;
        import flash.events.Event;
        public class Away3dScene extends Sprite
            //[Embed(source="assets/library.swf", symbol="Halo")]
            private var Halo:Class;
            //[Embed(source="assets/library.swf", symbol="Flare1")]
            private var Flare1:Class;
            //[Embed(source="assets/library.swf", symbol="Flare2")]
            private var Flare2:Class;
            //[Embed(source="assets/library.swf", symbol="Flare3")]
            private var Flare3:Class;
            private var _scene:Scene3D;
            private var _camera:Camera3D;
            private var _view:View3D;
            private var _flare:LensFlare;
            public function Away3dScene()
                this.addEventListener(Event.ADDED_TO_STAGE, init);
            private function init(evt:Event):void
                initScene();
                initObjects();
                this.addEventListener(Event.ENTER_FRAME, render);
            private function initObjects():void
                /*var floor:Plane = new Plane();
                floor.width = floor.height = 100000;
                floor.segmentsW = floor.segmentsH = 12;
                floor.y = -3500;
                floor.material = new WireColorMaterial(0x333333);
                _scene.addChild(floor);*/
                var flareSourceDummy:Object3D = new Object3D();
                flareSourceDummy.x = 1000;
                flareSourceDummy.y = 500;
                flareSourceDummy.z = 3000;
                _scene.addChild(flareSourceDummy);
                _flare = new LensFlare(flareSourceDummy, _camera);
                _flare.setBurnClip(_view);
                _flare.setHaloAsset(new Halo());
                _flare.addFlareAsset(new Flare1());
                _flare.addFlareAsset(new Flare3());
                _flare.addFlareAsset(new Flare1());
                _flare.addFlareAsset(new Flare2());
                _flare.useRotation = false;
                //_flare.useAlpha = false;
                //_flare.useScaling = false;
                //_flare.useBurning = false;
                //_flare.blendMode = BlendMode.SCREEN;
                //_flare.burnMethod = LensFlare.BURN_METHOD_COLOR_TRANSFORM;
                _view.addOverlay(_flare);
            private function hoverCamera():void
                var mX:Number = this.mouseX > 0 ? this.mouseX : 0;
                var mY:Number = this.mouseY > 0 ? this.mouseY : 0;
                var tarX:Number = 3*(mX - stage.stageWidth/2);
                var tarY:Number = -2*(mY - stage.stageHeight/2);
                var dX:Number = _camera.x - tarX;
                var dY:Number = _camera.y - tarY;
                _camera.x -= dX*0.25;
                _camera.y -= dY*0.25;
                _camera.lookAt(new Number3D(0, 0, 0));
            private function initScene():void
                _scene = new Scene3D();
                _camera = new Camera3D({z:-1500});
                _view = new View3D({scene:_scene, camera:_camera});
                _view.x = stage.stageWidth/2;
                _view.y = stage.stageHeight/2;
                _view.clipping = new RectangleClipping({minX:-stage.stageWidth/2, minY:-stage.stageHeight/2, maxX:stage.stageWidth/2, maxY:stage.stageHeight/2});
                _view.opaqueBackground = 0;
                addChild(_view);
            private function render(evt:Event):void
                hoverCamera();
                _view.render();
          Please guys, any idea will be helpful to me.
        Best,

    Yes, you right, now after i do what you explain appear more informations. 
      at Away3dScene/initObjects()[C:\Users\ahmed\Desktop\3d\Away3dScene.as:65]
        at Away3dScene/init()[C:\Users\ahmed\Desktop\3d\Away3dScene.as:44]
        at flash.display::DisplayObjectContainer/addChild()
        at Away3dProject()[C:\Users\ahmed\Desktop\3d\Away3dProject.as:17]
    error number 65 in Away3dScene is: _flare.setHaloAsset(new Halo());
    error number 44 in Away3dScene is: initObjects();
    error number 17 in Away3dProject.as is: addChild(scene);
    and the last error is: at flash.display::DisplayObjectContainer/addChild()
    But what is strange i test project at flash builder and he work fine, i just want move from flash builder to run in flash cs5.5, so i move Away3dProject.as, Away3dScene.as, and i add Away3d classes to flash cs5.5 and also   add net class to flash cs5.5.
    also i add all movies clips to my libriry project, please could you help me to find why i got this error with flash cs5.5.
    Best,

  • ActionScript 3 + PHP: TypeError: Error #2007: Parameter text must be non-null.

    Hi - Still new to flash as3 and php -
    it is a contact form page - user puts in information - i am to receive it in an email address their information
    as well the variables get sent back from the php to the .swf file.
    I am receiving these errors and not knowing how to fix them.
    any help would be much appreciated. thank you in advance really.
    below are the errors in flash - as3 code - and php code setup.
    errors:
    ActionScript 3 + PHP: TypeError: Error #2007: Parameter text must be non-null:
      at flash.text::TextField/set text()
              at kwangjaekim_fla::wholeform_16/completeHandler()
              at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at flash.net::URLLoader/flash.net:URLLoader::onComplete()
    my as3 code is the following:
    // build variable name for the URL Variables loader
    var variables:URLVariables = new URLVariables();
    //Build the varSend variable
    var varSend:URLRequest = new URLRequest("contact_parse.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    //Build the varLoader variable
    var varLoader:URLLoader = new URLLoader;
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);
    //handler for the PHP  script completion and return of status
    function completeHandler(event:Event):void{
              //value is cleared at ""
              name_txt.text = "";
              contact_txt.text = "";
              msg_txt.text = "";
              //Load the response PHP here
              status_txt.text = event.target.data.return_msg;
    //Add event listener for submit button click
    submit_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
    //function ValidateAndSend
    function ValidateAndSend(event:MouseEvent):void{
              //validate fields
              if(!name_txt.length){
                        status_txt.text = "Please Enter Your Name";
              }else if(!contact_txt.length){
                        status_txt.text = "Please Enter Your Contact Detail";
              }else if(!msg_txt.length){
                        status_txt.text = "Please Enter Your Message";
              }else {
              // ready the variables in form for sending
      variables.userName = name_txt.text;
              variables.userContact = contact_txt.text;
              variables.userMsg = msg_txt.text;
              // Send the data to PHP now
    varLoader.load(varSend);
    submit_btn.addEventListener(MouseEvent.CLICK, function(){MovieClip(parent).gotoAndPlay(151)});
              } // Close else condition for error handling
    } // Close validate and send function
    my php code is the following:
    <?php
    // Create local PHP variables from the info the user gave in the Flash form
    $senderName   = $_POST['userName'];
    $senderEmail     = $_POST['userContact'];
    $senderMessage = $_POST['userMsg'];
    // Strip slashes on the Local variables
    $senderName   = stripslashes($senderName);
    $senderContact     = stripslashes($senderContact);
    $senderMessage   = stripslashes($senderMessage);
    //!!!!!!!!!!!!!!!!!!!!!!!!!     change this to my email address     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                              $to = "put iny me email address";
         // Place sender Email address here
        $from = "$senderContact ";
        $subject = "Contact from your site";
        //Begin HTML Email Message
        $message = <<<EOF
    <html>
      <body bgcolor="#FFFFFF">
    <b>Name</b> = $senderName<br /><br />
    <b>Contact</b> = <a href="mailto:$senderContact">$senderEmail</a><br /><br />
    <b>Message</b> = $senderMessage<br />
      </body>
    </html>
    EOF;
       //end of message
        $headers  = "From: $from\r\n";
        $headers .= "Content-type: text/html\r\n";
        $to = "$to";
        mail($to, $subject, $message, $headers);
    exit();
    ?>
    thank you once again
    jay

    thank you Ned -
    i put in the trace line as you mentioned -
    and this is what i received -
    returns: undefined
    TypeError: Error #2007: Parameter text must be non-null
              at flash.text::TextField/set text()
              at kwangjaekim_fla::wholeform_16/completeHandler()
              at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at flash.net::URLLoader/flash.net:URLLoader::onComplete()
    what does this mean exactly?
    thank you for the help really

  • Java.lang.VerifyError - Incompatible object argument for function call

    Hi all,
    I'm developing a JSP application (powered by Tomcat 4.0.1 in JDK 1.3, in Eclipse 3.3). Among other stuff I have 3 classes interacting with an Oracle database, covering 3 use cases - renaming, adding and deleting an database object. The renaming class simply updates the database with a String variable it receives from the request object, whereas the other two classes perform some calculations with the request data and update the database accordingly.
    When the adding or deleting classes are executed, by performing the appropriate actions through the web application, Tomcat throws the following:
    java.lang.VerifyError: (class: action/GliederungNewAction, method: insertNewNode signature: (Loracle/jdbc/driver/OracleConnection;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V) Incompatible object argument for function call
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:120)
         at action.ActionMapping.perform(ActionMapping.java:53)
         at ControllerServlet.doResponse(ControllerServlet.java:92)
         at ControllerServlet.doPost(ControllerServlet.java:50)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    ...The renaming works fine though. I have checked mailing lists and forums as well as contacted the company's java support but everything I have tried out so far, from exchanging the xerces.jar files found in JDOM and Tomcat to rebuidling the project didn't help.
    I just can't explain to myself why this error occurs and I don't see how some additional Java code in the other 2 classes could cause it?
    I realize that the Tomcat and JDK versions I'm using are totally out of date, but that's company's current standard and I can't really change that.
    Here's the source code. I moved parts of the business logic from Java to Oracle recently but I left the SQL statements that the Oracle stored procedures are executing if it helps someone.
    package action;
    import java.sql.CallableStatement;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.StringTokenizer;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import oracle.jdbc.driver.OracleConnection;
    * This class enables the creation and insertion of a new catalogue node. A new node
    * is always inserted as the last child of the selected parent node.
    public class GliederungNewAction implements Action {
         public String perform(ActionMapping mapping, HttpServletRequest request,
                   HttpServletResponse response) {
              // fetch the necessary parameters from the JSP site
              // the parent attribute is the selected attribute!
              String parent_attribute = request.getParameter("attr");
              String catalogue = request.getParameter("catalogue");
              int parent_sequenceNr = Integer.parseInt(request.getParameter("sort_sequence"));
              // connect to database    
              HttpSession session = request.getSession();   
              db.SessionConnection sessConn = (db.SessionConnection) session.getAttribute("connection");
              if (sessConn != null) {
                   try {
                        sessConn.setAutoCommit(false);
                        OracleConnection connection = (OracleConnection)sessConn.getConnection();
                        int lastPosition = getLastNodePosition( getLastChildAttribute(connection, catalogue, parent_attribute) );
                        String newNodeAttribute = createNewNodeAttribute(parent_attribute, lastPosition);
                        // calculate the sequence number
                        int precedingSequenceNumber = getPrecedingSequenceNumber(connection, catalogue, parent_attribute);
                        if ( precedingSequenceNumber == -1 ) {
                             precedingSequenceNumber = parent_sequenceNr;
                        int sortSequence = precedingSequenceNumber + 1;
                        setSequenceNumbers(connection, catalogue, sortSequence);
                        // insert the new node into DB
                        insertNewNode(connection, catalogue, newNodeAttribute, parent_attribute, "Neuer Punkt", sortSequence);
                        connection.commit();
                   } catch(SQLException ex) {
                        ex.printStackTrace();
              return mapping.getForward();
          * Creates, fills and executes a prepared statement to insert a new entry into the specified table, representing
          * a new node in the catalogue.
         private void insertNewNode(OracleConnection connection, String catalogue, String attribute, String parent_attribute, String description, int sortSequence) {
              try {
                   String callAddNode = "{ call fasi_lob.pack_gliederung.addNode(:1, :2, :3, :4, :5) }";
                   CallableStatement cst;
                   cst = connection.prepareCall(callAddNode);
                   cst.setString(1, catalogue);
                   cst.setString(2, attribute);
                   cst.setString(3, parent_attribute);
                   cst.setString(4, description);
                   cst.setInt(5, sortSequence);
                   cst.execute();
                   cst.close();
              } catch (SQLException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
    //          String insertNewNode = "INSERT INTO vstd_media_cat_attributes " +
    //                    "(catalogue, attribute, parent_attr, description, sort_sequence) VALUES(:1, :2, :3, :4, :5)";
    //          PreparedStatement insertStmt;
    //          try {
    //               insertStmt = connection.prepareStatement(insertNewNode);
    //               insertStmt.setString(1, catalogue);
    //               insertStmt.setString(2, attribute);
    //               insertStmt.setString(3, parent_attribute);
    //               insertStmt.setString(4, description);
    //               insertStmt.setInt(5, sortSequence);
    //               insertStmt.execute();
    //               insertStmt.close();
    //          } catch (SQLException e) {
    //               e.printStackTrace();
          * This method returns the attribute value of the last child of the parent under which
          * we want to insert a new node. The result set is sorted in descending order and only the
          * first result (that is, the last child under this parent) is fetched.
          * If the parent node has no children, "parent_attr.0" is returned. 
          * @param connection
          * @param catalogue
          * @param parent_attribute
          * @return attribute of the last child under this parent, or "parent_attr.0" if parent has no children
         private String getLastChildAttribute(OracleConnection connection, String catalogue, String parent_attribute) {
              String queryLastChild = "SELECT attribute FROM vstd_media_cat_attributes " +
                                            "WHERE catalogue=:1 AND parent_attr=:2 ORDER BY sort_sequence DESC";
              String lastChildAttribute;
              PreparedStatement ps;
              try {
                   ps = connection.prepareStatement(queryLastChild);
                   ps.setString(1, catalogue);
                   ps.setString(2, parent_attribute);
                   ResultSet rs = ps.executeQuery();
                   /* If a result is returned, the selected parent already has children.
                    * If not set the lastChildAttribute to parent_attr.0
                   if (rs.next()) {
                        lastChildAttribute = rs.getString("attribute");
                   } else {
                        lastChildAttribute = parent_attribute.concat(".0");
                   rs.close();
                   return lastChildAttribute;
              } catch (SQLException e) {
                   e.printStackTrace();
                   return null;
          * This helper method determines the position of the last node in the attribute.
          * i.e for 3.5.2 it returns 2, for 2.1 it returns 1 etc.
          * @param attribute
          * @return position of last node in this attribute
         private int getLastNodePosition(String attribute) {
              StringTokenizer tokenizer = new StringTokenizer(attribute, ".");
              String lastNodePosition = "0";
              while( tokenizer.hasMoreTokens() ) {
                   lastNodePosition = tokenizer.nextToken();
              return Integer.parseInt(lastNodePosition);
          * This method calculates the attribute of a node being inserted
          * by incrementing the last child position by 1 and attaching the
          * incremented position to the parent.
          * @param parent_attr
          * @param lastPosition
          * @return attribute of the new node
         private String createNewNodeAttribute(String parent_attr, int lastPosition) {
              String newPosition = new Integer(lastPosition + 1).toString();
              return parent_attr.concat("." + newPosition);
          * This method checks if the required sequence number for a new node is already in use and
          * handles the sequence numbers accordingly.
          * If the sequence number for a new node is NOT IN USE, the method doesn't do anything.
          * If the sequence number for a new node is IN USE, the method searches for the next free
          * sequence number by incrementing the number by one and repeating the query until no result
          * is found. Then all the sequence numbers between the required number (including, >= relation)
          * and the nearest found free number (not including, < relation) are incremented by 1, as to
          * make space for the new node.
          * @param connection
          * @param catalogue
          * @param newNodeSequenceNumber required sequence number for the new node
         private void setSequenceNumbers(OracleConnection connection, String catalogue, int newNodeSequenceNumber) {
              // 1. check if the new sequence number exists - if no do nothing
              // if yes - increment by one and see if exists
              //           repeat until free sequence number exists
              // when found increment all sequence numbers freeSeqNr > seqNr >= newSeqNr
              String query = "SELECT sort_sequence FROM vstd_media_cat_attributes " +
                        "WHERE catalogue=:1 AND sort_sequence=:2";
              PreparedStatement ps;
              try {
                   ps = connection.prepareStatement(query);
                   ps.setString(1, catalogue);
                   ps.setInt(2, newNodeSequenceNumber);               
                   ResultSet rs = ps.executeQuery();
                   // if no result, the required sequence number is free - nothing to do
                   if( rs.next() ) {
                        int freeSequenceNumber = newNodeSequenceNumber;
                        do {
                             ps.setString(1, catalogue);
                             ps.setInt(2, freeSequenceNumber++);
                             rs = ps.executeQuery();
                        } while( rs.next() );
                        // increment sequence numbers - call stored procedure
                        String callUpdateSeqeunceNrs = "{ call fasi_lob.pack_gliederung.updateSeqNumbers(:1, :2, :3) }";
                        CallableStatement cst = connection.prepareCall(callUpdateSeqeunceNrs);
                        cst.setString(1, catalogue);
                        cst.setInt(2, newNodeSequenceNumber);
                        cst.setInt(3, freeSequenceNumber);
                        cst.execute();
                        cst.close();
    //                    String query2 = "UPDATE vstd_media_cat_attributes " +
    //                                      "SET sort_sequence = (sort_sequence + 1 ) " +
    //                                      "WHERE catalogue=:1 sort_sequnce >=:2 AND sort_sequence <:3";
    //                    PreparedStatement ps2;
    //                    ps2 = connection.prepareStatement(query2);
    //                    ps2.setString(1, catalogue);
    //                    ps2.setInt(2, newNodeSequenceNumber);
    //                    ps2.setInt(3, freeSequenceNumber);
    //                    ps.executeUpdate();
    //                    ps.close();
                   } // end of if block
                   rs.close();
              } catch (SQLException e) {
                   e.printStackTrace();
          * This method finds the last sequence number preceding the sequence number of a node
          * that is going to be inserted. The preceding sequence number is required to calculate
          * the sequence number of the new node.
          * We perform a hierarchical query starting from the parent node: if a result is returned,
          * we assign the parent's farthest descendant's node sequence number; if no result
          * is returned, we assign the parent's sequence number.
          * @param connection
          * @param catalogue
          * @param parent_attr parent attribute of the new node
          * @return
         private int getPrecedingSequenceNumber(OracleConnection connection, String catalogue, String parent_attr) {
              int sequenceNumber = 0;
              String query = "SELECT sort_sequence FROM vstd_media_cat_attributes " +
                                "WHERE catalogue=:1 " +
                                "CONNECT BY PRIOR attribute = parent_attr START WITH parent_attr=:2 " +
                                "ORDER BY sort_sequence DESC";
              try {
                   PreparedStatement ps = connection.prepareStatement(query);
                   ps.setString(1, catalogue);
                   ps.setString(2, parent_attr);
                   ResultSet rs = ps.executeQuery();
                   if ( rs.next() ) {
                        sequenceNumber = rs.getInt("sort_sequence");
                   } else {
                        // TODO: ggf fetch from request!
                        sequenceNumber = -1;
                   rs.close();
                   ps.close();
              } catch (SQLException e) {
                   e.printStackTrace();
              return sequenceNumber;
    }

    After further googling I figured out what was causing the problem: in eclipse I was referring to external libraries located in eclipse/plugins directory, whereas Tomcat was referring to the same libraries (possibly older versions) in it's common/lib directory.

  • New to action script and getting: TypeError: Error #1009: Cannot access a property or method of a nu

    I am getting this message in the output tab for buttons that I am trying to create.  Here's the code:
    import flash.events.MouseEvent;
    stop();
    function goHome(myEvent:MouseEvent):void {
    gotoAndStop("home");
    SoundMixer.stopAll();
    function goAbout(myEvent:MouseEvent):void {
    gotoAndStop("about");
    SoundMixer.stopAll();
    function goBusiness(myEvent:MouseEvent):void {
    gotoAndStop("business");
    SoundMixer.stopAll();
    function goContact(myEvent:MouseEvent):void {
    gotoAndStop("contact");
    SoundMixer.stopAll();
    function goArchives(myEvent:MouseEvent):void {
    gotoAndStop("archives");
    SoundMixer.stopAll();
    function goBioTech(myEvent:MouseEvent):void {
    gotoAndStop("bioTech");
    SoundMixer.stopAll();
    function goRealEstate(myEvent:MouseEvent):void {
    gotoAndStop("realEstate");
    SoundMixer.stopAll();
    function goTechnology(myEvent:MouseEvent):void {
    gotoAndStop("technology");
    SoundMixer.stopAll();
    function goEnergy(myEvent:MouseEvent):void {
    gotoAndStop("energy");
    SoundMixer.stopAll();
    home_btn.addEventListener(MouseEvent.CLICK, goHome);
    about_btn.addEventListener(MouseEvent.CLICK, goAbout);
    business_btn.addEventListener(MouseEvent.CLICK, goBusiness);
    contact_btn.addEventListener(MouseEvent.CLICK, goContact);
    archives_btn.addEventListener(MouseEvent.CLICK, goArchives);
    bioTech_btn.addEventListener(MouseEvent.CLICK, goBioTech);
    realEstate_btn.addEventListener(MouseEvent.CLICK, goRealEstate);
    technology_btn.addEventListener(MouseEvent.CLICK, goTechnology);
    energy_btn.addEventListener(MouseEvent.CLICK, goEnergy);
    I ran the debugger and got this:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at peakInsights_fla::MainTimeline/frame1()[peakInsights_fla.MainTimeline::frame1:48]
    I guess it's telling me there's a problem with line 48 but what?
    The home, about, business, contact, and archives button works. On the business page there are the remaining buttons biotech, technology, real estate, and energy. when i test it; i get the finger but the buttons don't work. this is my first flash site so I'am new, new.

    I followed the steps and read some of your comments on the same top topic in another thread. When I put it on the first frame it was okay but the next button on that page had the same problem.  So what I am guessing is that I have to either create a document class or put the actions where the buttons are.  Am I understanding that correctly?  In the other thread in which you helped someone else; there was so comments about document class.  I found a tutorial on it and the way I understand it is that it you can put you actions in an external document.  But you have to include in the event listener the frame in which you want that action to happen.
    Thaks for your help.  And patience.

Maybe you are looking for