Error: 1026 "Constructor Functions must be instanst methods".  Why?

I am being told that this error takes place on Line 3, which is blank. I can not figure out what the problem could possibly be. Any help would be greatly appreciated.
package {
import flash.display.*;
public class toppings extends MovieClip {
  var inventory:Sweettreat;
  function toppings() {
   inventory = new Sweettreat(this);
   inventory.makeSweettreatItems([MCsprinkles,MCchocolate,MCcaramel,MCnuts,MCcherry]);

The above is the code from the as file.
Here is the corresponding flash code:
cone_or_bowl.addEventListener(MouseEvent.MOUSE_DOWN, coneorbowlchoice);
function coneorbowlchoice(event:MouseEvent):void {
    gotoAndStop(6);
scoops.addEventListener(MouseEvent.MOUSE_DOWN, scoopschoice);
function scoopschoice(event:MouseEvent):void {
    gotoAndStop(8);
flavors.addEventListener(MouseEvent.MOUSE_DOWN, flavorchoice);
function flavorchoice(event:MouseEvent):void {
    gotoAndStop(10);
toppings.addEventListener(MouseEvent.MOUSE_DOWN, toppingchoice);
function toppingchoice(event:MouseEvent):void {
    gotoAndStop(12);

Similar Messages

  • Error: 1026: Constructor functions must be instance methods.

    I am follwoing a tutorial on linda.com about creating a website in Flash
    everything was going well until i started trying to copy the action script in the online examples
    now I keep getting this error message and can't figure out how to get rid of it:
    1026: Constructor functions must be instance methods.
    any assistance wouold be much appreciated, thank you
    here is the action script I am using for my buttons:
    stop();
    tv.addEventListener(MouseEvent.CLICK, clickSection);
    function clickSection(evtObj:MouseEvent){
    gotoAndStop("tv");

    I'm sorry, I am still not following what you are saying
    here is what I have in the actions layer, frame 1
    stop();
    tv.addEventListener(MouseEvent.CLICK, clickSection);
    anim.addEventListener(MouseEvent.CLICK, clickSection);
    ads.addEventListener(MouseEvent.CLICK, clickSection);
    photo.addEventListener(MouseEvent.CLICK, clickSection);
    film.addEventListener(MouseEvent.CLICK, clickSection);
    home.addEventListener(MouseEvent.CLICK, clickSection);
    function clickSection(evtObj:MouseEvent){
    trace ("The "+evtObj.target.name+" button was clicked!")
    gotoAndStop(evtObj.target.name);
    I am trying to link markers on the actions time line: tv, anim, ads, photo, film and home
    with layers (web pages) on the time line below...

  • Constructor functions must be instance methods?

    Hi,
    I have this code as in the following:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:Script>
            <![CDATA[
                import mx.controls.*;           
                import mx.events.*;
                import mx.containers.*;       
                import thematicMap.*;  
                 public var Region:Region = new Region();
                 public var Scale:Scale = new Scale();
                 public var ThematicMap:ThematicMap = new ThematicMap(); //1026:Constructor functions must be instance methods
                 public var ReadXML:ReadXML = new ReadXML();       
                 private var savedIndex:int= 99999;        
                  public function addNavigation():void{
                      var buttonTools:Array = ["Driving Distance","Education Level--College",
                                               "Education Level--High School","Median Income","Population"];
                      var navigationBar:ToggleButtonBar = new ToggleButtonBar();
                          navigationBar.dataProvider = buttonTools;
                          navigationBar.toggleOnClick = true;
                          navigationBar.selectedIndex = -1;
                          navigationBar.addEventListener(ItemClickEvent.ITEM_CLICK,clickHandler);                      
                          //pass the variables?
                          addSlider(); //add the slider control  
                          vbox.addChild(navigationBar);
                  public function addSlider():void{
                       var text_entry:HBox = new HBox();                 
                       var numColors:TextInput = new TextInput();
                           numColors.length == 3;
                           numColors.text = "5";
                           numColors.restrict = "0-9";
                       var direction:Text= new Text();
                           direction.text = "Number of Colors";
                        //recalculate the map if the listener is called
                       text_entry.addChild(direction);
                       text_entry.addChild(numColors);
                       vbox.addChild(text_entry);                    
                 public function clickHandler(event:ItemClickEvent):void{
                     if(event.index == savedIndex) {
                         //don't do a thing
                     else savedIndex = event.index;           
                     //add the thematic map                
                     ThematicMap.addRegions(OK); //This part never worked
                     //mapGrid.addChild(thematicmap);
            ]]>
        </mx:Script>
       <mx:Canvas id="map" creationComplete="addNavigation()">
               <mx:VBox id="vbox" x="20" y="10">           
               <mx:Canvas id="mapGrid"/>      
        </mx:VBox>     
       </mx:Canvas>
    </mx:Application>
    Here is what I have in my ThematicMap.as:
    package thematicMap
        import mx.core.*;
        import mx.events.*;
        public class ThematicMap {       
            public var region:Region = new Region();  
            public var readXML:ReadXML = new ReadXML();     
            public function addRegions(name:String):void {   
                 trace(name);      
    Have I done something wrong here? How come it keeps telling me that the constructor functions must be instance methods?
    Thanks for your help.
    Alice

    Yes, I put in the quotes, and that took care of that error.
    However, it still tells me I have an error that I am calling a possibly undefined method addRegions through a reference with static type ThematicMap
    Here is the complete code of my main app:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:Script>
            <![CDATA[
                import mx.controls.*;           
                import mx.events.*;
                import mx.containers.*;       
                import thematicMap.*;   //I had imported all the classes
                 public var region:Region = new Region();
                 public var scale:Scale = new Scale();
                 public var thematicMaps:ThematicMap = new ThematicMap();
                 public var readXML:ReadXML = new ReadXML();       
                 private var savedIndex:int= 99999;        
                  public function addNavigation():void{
                      var buttonTools:Array = ["Driving Distance","Education Level--College",  "Education Level--High School","Median Income","Population"];
                      var navigationBar:ToggleButtonBar = new ToggleButtonBar();
                          navigationBar.dataProvider = buttonTools;
                          navigationBar.toggleOnClick = true;
                          navigationBar.selectedIndex = -1;
                          navigationBar.addEventListener(ItemClickEvent.ITEM_CLICK,clickHandler);                      
                          //pass the variables?
                          addSlider(); //add the slider control  
                          vbox.addChild(navigationBar);
                  public function addSlider():void{
                       var text_entry:HBox = new HBox();                 
                       var numColors:TextInput = new TextInput();
                           numColors.length == 3;
                           numColors.text = "5";
                           numColors.restrict = "0-9";
                       var direction:Text= new Text();
                           direction.text = "Number of Colors";
                        //recalculate the map if the listener is called
                       text_entry.addChild(direction);
                       text_entry.addChild(numColors);
                       vbox.addChild(text_entry);                    
                 public function clickHandler(event:ItemClickEvent):void{
                     if(event.index == savedIndex) {
                         //don't do a thing
                     else savedIndex = event.index;           
                     //add the thematic map                
                     thematicMaps.addRegions("OK");
                     //mapGrid.addChild(thematicmap);
            ]]>
        </mx:Script>
       <mx:Canvas id="map" creationComplete="addNavigation()">
               <mx:VBox id="vbox" x="20" y="10">           
               <mx:Canvas id="mapGrid"/>      
        </mx:VBox>     
       </mx:Canvas>
    </mx:Application>
    As a matter of fact, when I write import thematicMap. it looks like thematicMap.ThematicMap does show up, so that is imported, right?
    I am getting confused.
    Alice

  • Constructor function must be instance method Error

    Hi I m got puzzled that How this error happen, Last time I finish the project all modules was working properly, but today I open file and render then I wounder the all base classes of Linkage object is missing and if i give them(flash.dispaly.MovieClip) manually then it dosen't show any error and it dosen't accept. When I delete the class of any linkage object then It accept base class of linkage object. How can I solve the Problem.???

    Hi,
    I clicked that option under the "Flash" tab and the same curt error message appeared.
    I'll try to answer your question on how I put together the file.
    The file contains static art, static text and a movie clip that runs through twice.  All that functions fine.
    **Perhaps I need to change the name in various locations relate to the button and the actions.  Here's what I did next:
    I then added a layer and called it "invisibleBtn"
    Drew a rectangle and converted it to a symbol and called it "invisibleBtn" - I also labeled it "invisibleBtn" in the window under the "Properties" tab when you click the rectangle in Scene 1 (can't remember what that box is called)
    I added another layer and called it "ActionScript"
    I called up the Actions-Frame window and added this code:
    invsibleBtn.addEventListener(MouseEvent.CLICK,onClick);
    function onClick(event:MouseEvent):void {
    navigateToURL(new URLRequest ("http://www.fcnmarketingsolutions.com"));
    I hope this is what you were asking for in your message.
    Thanks.

  • "constructor functions must be" error

    i have this code snippet that i originally got from the snippet library, but i'm applying it to a new document. i made a square and converted it to a symbol, then gave an instance name of myMovieClip. i put this actionscript code in the first frame with it:
    stage.addEventListener(KeyboardEvent.KEY_DOWN, keymoving);
    function keymoving(event:KeyboardEvent):void
              switch (event.keyCode)
                        case Keyboard.UP:
                                  myMovieClip.y -=5;
                                  break;
                        case Keyboard.DOWN:
                                  myMovieClip.y +=5;
                                  break;
    case Keyboard.LEFT:
                                  myMovieClip.x -=5;
                                  break;
    case Keyboard.RIGHT:
                                  myMovieClip.x +=5;
                                  break;
    and now i get this error: Constructor functions must be instance methods

    thanks for confirming this for me. i thought it was suspicious too.
    so i made a new document and paid closer attention to how i'm setting up my actionscript code. i think in the first example i had inserted it into the wrong place which made it go haywire. now i have it working.

  • Error 1026 invalid reference at runVI invoke method in main exe- subVI- subpanel

    Hello,
    I have a main VI which have subVI's inside case structures set up to show FP when called and be modal.
    These subVIs have a subpanel that will pull up a dynamicVI using RunVI invoke method.The dymaicVIs path is built using application directory constant+the VI name to the invoke method.
    now the main VI is built into exe with the dynamicVIs in always included list. 
    when i run the main exe i am getting 1026 error VI reference invalid. 
    Plz help
    Thanks
    Solved!
    Go to Solution.

    Hi Freemason,
    The problem could be coming from the use of relative paths, because the path can sometimes change when building an application. Double check to make sure they are calling the right path. You can also try changing the AutoDispose Refnum in your run VI invoke node to false. It is one of the methods you can select in your run VI invoke node. If neither of these solutions work, run your code using the highlight execution function. If you implemented error handling in your program, you should be able to see the source of the error.
    If you’re still having issues, could you post some screenshots or your actual VI? I may be able to get a better idea of the issue that way. I’ve also attached an example VI that uses multiple subVIs and a subpanel for reference.  Hope this helps.
    Paul C
    Applications Engineer
    National Instruments
    Attachments:
    Multiple VIs in a Subpanel.vi ‏19 KB

  • Error while calling a super class public method in the subclass constructor

    Hi ,
    I have code like this:
    CLASS gacl_applog DEFINITION ABSTRACT.
      PUBLIC SECTION.
        METHODS:
                create_new_a
                   IMPORTING  pf_obj       TYPE balobj_d
                              pf_subobj    TYPE balsubobj
                              pf_extnumber TYPE string
                   EXPORTING  pfx_log_hndl TYPE balloghndl
                   EXCEPTIONS error
    ENDCLASS.
    CLASS gacl_applog IMPLEMENTATION.
      METHOD create_new_a.
        DATA: ls_log TYPE bal_s_log.
      Header aufsetzen
        MOVE pf_extnumber TO ls_log-extnumber.
        ls_log-object     = pf_obj.
        ls_log-subobject  = pf_subobj.
        ls_log-aluser     = sy-uname.
        ls_log-alprog     = sy-repid.
        ls_log-aldate     = sy-datum.
        ls_log-altime     = sy-uzeit.
        ls_log-aldate_del = ls_log-aldate + 1.
        CALL FUNCTION 'BAL_LOG_CREATE'
             EXPORTING
                  i_s_log      = ls_log
             IMPORTING
                  e_log_handle = pfx_log_hndl
             EXCEPTIONS
                  OTHERS       = 1.
        IF ( sy-subrc NE 0 ).
          MESSAGE ID      sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH    sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                  RAISING error.
        ENDIF.
      ENDMETHOD.
    CLASS gcl_applog_temp DEFINITION INHERITING FROM gacl_applog.
      PUBLIC SECTION.
        DATA: log_hndl   TYPE balloghndl READ-ONLY
            , t_log_hndl TYPE bal_t_logh READ-ONLY
        METHODS: constructor
                   IMPORTING  pf_obj       TYPE balobj_d
                              pf_subobj    TYPE balsubobj
                              pf_extnumber TYPE string
                   EXCEPTIONS error
               , msg_add      REDEFINITION
               , display      REDEFINITION
    ENDCLASS.
    CLASS gcl_applog_temp IMPLEMENTATION.
      METHOD constructor.
        CALL METHOD create_new_a
               EXPORTING  pf_obj       = pf_obj
                          pf_subobj    = pf_subobj
                          pf_extnumber = pf_extnumber
               IMPORTING  pfx_log_hndl = log_hndl.
        IF ( sy-subrc NE 0 ).
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                  RAISING error.
        ENDIF.
      ENDMETHOD.
    A public method of Super class has been called from the constructor of the sub class. we are getting the syntax error :
    ' In the constructor method, you can only access instance attributes, instance methods, or "ME" after calling the constructor of the superclass…'
    Can you please suggest how to change the code with out affecting the functioanlity.
    Thank you ,
    Lakshmi.

    Hi,
    Call that method by instance of Subclass.   OR
    SUPER-->method.
    Read very useful document
    Constructors
    Constructors are special methods that cannot be called using CALL METHOD. Instead, they are called automatically by the system to set the starting state of a new object or class. There are two types of constructors - instance constructors and static constructors. Constructors are methods with a predefined name. To use them, you must declare them explicitly in the class.
    The instance constructor of a class is the predefined instance method CONSTRUCTOR. You declare it in the public section as follows:
    METHODS CONSTRUCTOR
            IMPORTING.. [VALUE(]<ii>[)] TYPE type [OPTIONAL]..
            EXCEPTIONS.. <ei>.
    and implement it in the implementation section like any other method. The system calls the instance constructor once for each instance of the class, directly after the object has been created in the CREATE OBJECT statement. You can pass the input parameters of the instance constructor and handle its exceptions using the EXPORTING and EXCEPTIONS additions in the CREATE OBJECT statement.
    The static constructor of a class is the predefined static method CLASS_CONSTRUCTOR. You declare it in the public section as follows:
    CLASS-METHODS CLASS_CONSTRUCTOR.
    and implement it in the implementation section like any other method. The static constructor has no parameters. The system calls the static constructor once for each class, before the class is accessed for the first time. The static constructor cannot therefore access the components of its own class.
    Pls. reward if useful....

  • Why sap.ui.view is just a method & not a constructor function ?

    Hey,
    Every control in UI5 is defined as a Constructor Function, but why is sap.ui.view which is also a control just defined as a method !! Any reasons behind it?
    Thanks & Regards
    Sakthivel

    sorry, the 'would you mind' wasn't meant to sound
    snotty! its amazing how bad forums can be for getting
    feeling across. I meant to say something like 'oh
    hell, I can't see how to do this. I don't suppose you
    happen to have an example lying around the place, do
    you?'
    I'll give it a go...I sounded a bit harsh perhaps. Sorry.
    I only saw someone give an answer and a couple of minutes later a follow-up asking for "example code", which lead me to believe you did not do any research/googling on what was suggested. I now read your original post and saw that you already knew of the AffineTransform class.
    Anyway, when I want to see some classes "in action" I always go to http://www.exampledepot.com . It also has some snippets on how to use the AffineTransform class:
    http://www.google.com/custom?domains=exampledepot.com&q=AffineTransform&sa=Google+Search&sitesearch=exampledepot.com&client=pub-6001183370374757&forid=1&ie=ISO-8859-1&oe=ISO-8859-1&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A1%3B&hl=en
    Good luck.

  • Muse JS Assert: Error calling selector function:Type error: Object has no method Muse Menu

    When exporting html and viewing locally we receive the following error... This error disappears after removing menu from top of page. This error does not occur when viewed on Outdoors360.businesscatalyst.com (our temporary site)
    Muse JS Assert: Error calling selector function:Type error: Object has no method Muse Menu
    Any ideas??

    I fix the problem.
    I have carefully reviewed JAVASCRIPT files and I could see that these are not a major influence within the site, only are reference code and utilities of the same application.
    By removing these files nothing has stopped working, I thought I would have some error in the sliders, or opacities, but no, nothing happened.
    DELETE IT
    FRANCISCO CATALDO DISEÑADOR GRÁFICO

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

  • 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

  • Type's constructor function is called as many times as there are attributes

    The constructor method for object types is being called multiple times by SQL when using the constructor in an SQL insert statement. For example, if I create an object type called TEST_O, and an object table TEST_OT based on type TEST_O, and then insert into TEST_OT using the constructor:
    INSERT INTO TEST_OT VALUES ( TEST_O( TEST_ID_SEQ.nextval, 'Test', USER, SYSDATE ) );
    The contructor is actually called 5 times by SQL. Here's a sample type, table, type body, and anonymous PL/SQL procedure that reproduces this error:
    create type TEST_O as object (
    test_o.tps
    by Donald Bales on 3/1/2007
    Type TEST_O's specification:
    A type for debugging object type problems
    test_id number,
    test varchar2(30),
    insert_user varchar2(30),
    insert_date date,
    -- Get the next primary key value
    STATIC FUNCTION get_id
    return number,
    -- A NULL values constructor
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o)
    return self as result,
    -- A convenience constructor
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o,
    aiv_test in varchar2)
    return self as result,
    -- Override the defaul constructor
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o,
    test_id in number,
    test in varchar2,
    insert_user in varchar2,
    insert_date in date)
    return self as result,
    -- Write to the debug object table
    STATIC PROCEDURE set_test(
    aiv_test in varchar2),
    -- A map function
    MAP MEMBER FUNCTION to_map
    return number
    ) not final;
    grant all on TEST_O to PUBLIC;
    ========================
    create table TEST_OT of TEST_O
    tablespace USERS pctfree 0
    storage (initial 1M next 1M pctincrease 0);
    alter table TEST_OT add
    constraint TEST_OT_PK
    primary key (
    test_id )
    using index
    tablespace USERS pctfree 0
    storage (initial 1M next 1M pctincrease 0);
    drop sequence TEST_ID_SEQ;
    create sequence TEST_ID_SEQ
    start with 1 order;
    analyze table TEST_OT estimate statistics;
    grant all on TEST_OT to PUBLIC;
    ============================
    create or replace type body TEST_O as
    test_o.tpb
    by Donald Bales on 3/1/2007
    Type TEST_O's implementation
    A type for logging test information
    STATIC FUNCTION get_id
    return number is
    n_test_id number;
    begin
    select TEST_ID_SEQ.nextval
    into n_test_id
    from SYS.DUAL;
    return n_test_id;
    end get_id;
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o)
    return self as result is
    begin
    SYS.DBMS_OUTPUT.put_line('test_o(zero param)');
    self.test_id := NULL;
    self.test := NULL;
    self.insert_user := NULL;
    self.insert_date := NULL;
    return;
    end test_o;
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o,
    aiv_test in varchar2)
    return self as result is
    begin
    SYS.DBMS_OUTPUT.put_line('test_o(one param)');
    self.test_id := TEST_O.get_id();
    self.test := aiv_test;
    self.insert_user := USER;
    self.insert_date := SYSDATE;
    return;
    end test_o;
    -- Override the default constructor
    CONSTRUCTOR FUNCTION test_o(
    self in out nocopy test_o,
    test_id in number,
    test in varchar2,
    insert_user in varchar2,
    insert_date in date)
    return self as result is
    begin
    SYS.DBMS_OUTPUT.put_line('test_o(four params)');
    self.test_id := test_id;
    self.test := test;
    self.insert_user := insert_user;
    self.insert_date := insert_date;
    return;
    end test_o;
    STATIC PROCEDURE set_test(
    aiv_test in varchar2) is
    begin
    insert into TEST_OT values ( TEST_O(aiv_test) );
    end set_test;
    MAP MEMBER FUNCTION to_map
    return number is
    begin
    return test_id;
    end to_map;
    end;
    ====================
    begin
    TEST_O.set_test('Before loop');
    for i in 1..10 loop
    TEST_O.set_test('Testing loop '||to_char(i));
    end loop;
    TEST_O.set_test('After loop');
    commit;
    end;
    ==========================
    Which produces the following output:
    SQL> @test_o
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    test_o(one param)
    PL/SQL procedure successfully completed.
    SQL> select * from test_ot order by 1;
    TEST_ID TEST INSERT_USER INSERT_DATE
    2 Before loop SCOTT 20070301 173715
    7 Testing loop 1 SCOTT 20070301 173715
    12 Testing loop 2 SCOTT 20070301 173715
    17 Testing loop 3 SCOTT 20070301 173715
    22 Testing loop 4 SCOTT 20070301 173715
    27 Testing loop 5 SCOTT 20070301 173715
    32 Testing loop 6 SCOTT 20070301 173715
    37 Testing loop 7 SCOTT 20070301 173715
    42 Testing loop 8 SCOTT 20070301 173715
    47 Testing loop 9 SCOTT 20070301 173715
    52 Testing loop 10 SCOTT 20070301 173715
    57 After loop SCOTT 20070301 173715
    12 rows selected.
    Is it possible to get an Oracle employee to look into this problem?
    Sincerely,
    Don Bales

    Here some sample JavaScript code that might help you resolve the issue.
    var curPageNum = xfa.host.currentPage + 1; // this is index
    // based starts with 0
    if (curPageNum == 1) {
    // run your current script here then it will run only one
    //time on page 1

  • Flash Builder - RDS - LCDS - 1020: Method marked override must override another method

    I'm using RDS data modeller, the RDS fml file is working okay,
    I can work with the tables, use services
    but when I try to run the application I get prolems, and the problem states:
    Description
    Resource
    Path
    Location
    Type
    1020: Method marked override must override another method.
    _CityEntityMetadata.as
    /xoffer/src/xoffer
    line 219
    Flex Problem
    This issue extract is: for example: _CityEntityMetadata.as
        override public function getPropertyType(propertyName:String):String
            if (model_internal::allProperties.indexOf(propertyName) == -1)
                throw new Error(propertyName + " is not a property of City");
            return model_internal::propertyTypeMap[propertyName];
    this for some tables
    how does this present, I didn't do sth special, followed the how to online, already reinstalled the whole thing (flash builder 4.5.1, modeller 3.1.1)
    workflow:
    -> created in MySQL the Database
    -> used the RDS config (this works)
    -> generate the code and push to the server
    -> make a datagrid and link it to a service
    -> play => errors get detected
    ps when I delete the override it is ok, but I don't think this should be the case....

    I'm also experiencing this problem.  It's a real pain in the neck to have to do extended search / replace on certain method signatures to remove the override.
    Anyone have a solution?
    Thanks in advance!

  • How to call a C function calling a Java Method from another C function ?

    Hi everyone,
    I'm just starting to learn JNI and my problem is that I don't know if it is possible to call a C function calling a Java Method (or doing anything else with JNI) from another C function.
    In fact, after receiving datas in a socket made by a C function, I would like to create a class instance (and I don't know how to do it too ; ) ) and init this instance with the strings I received in the socket.
    Is all that possible ?
    Thank you very much for your help !

    Hard to understand the question, but by most interpretations the answer is going to be yes.
    You do of course understand that JNI is the "API" that sits between Java and C and that every call between the two must go through that. You can't call it directly.

  • Error in Constructor

    So i mod GTA IV with c#
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.IO;
    using System.Windows.Forms;
    using System.Drawing;
    using System.Diagnostics;
    using System.Collections.Generic;
    using GTA;
    using GTA.Native;
    namespace Beggar
    public class ambBeggar : Script
    bool tb = false;
    bool bp = true;
    Ped rped;
    AnimationSet beggarsitting;
    AnimationSet beggarstanding;
    Keys begkey;
    GTA.Timer gmoney;
    public ambBeggar()
    gmoney.Interval = 120000;
    gmoney.Tick += gmoney_Tick;
    begkey = Settings.GetValueKey("Beg", "Beggar Mod", Keys.B);
    if(!File.Exists(Settings.Filename))
    Settings.SetValue("Beg", "Beggar Mod", Keys.B);
    this.Interval = 100000;
    this.Tick += new EventHandler(ambBeggar_get);
    this.ConsoleCommand += new ConsoleEventHandler(ambBeggar_ConsoleCommand);
    public void ambBeggar_get(object sender, EventArgs e)
    if(tb == true && !rped.Exists())
    rped = World.GetClosestPed(Player.Character.Position, 30);
    public void gmoney_Tick(object sender, EventArgs e)
    if (rped.Exists())
    rped.Task.GoTo(Player.Character.Position.Around(2));
    Pickup.CreateMoneyPickup(rped.Position, 1000);
    rped.NoLongerNeeded();
    public void ambBeggar_ConsoleCommand(object sender, ConsoleEventArgs e)
    if(e.Command == "t_beggar" && tb == false)
    tb = true;
    Function.Call("REQUEST_ANIMS", "amb@beg_sitting");
    //Function.Call("REQUEST_ANIMS","amb@beg_standing");
    if (Function.Call<bool>("HAVE_ANIMS_LOADED","amb@beg_standing") /*&& Function.Call<bool>("HAVE_ANIMS_LOADED","amb@beg_sitting")*/)
    msg("Press" + begkey.ToString() + "To Beg", 5000);
    beggarsitting = new AnimationSet("amb@beg_sitting");
    //beggarstanding = new AnimationSet("amb@beg_standing");
    Player.Character.Animation.Play(beggarsitting, "beggar_sit", 8, AnimationFlags.Unknown05);
    while(tb == true)
    beg_playing();
    if(Game.isKeyPressed(begkey))
    Player.Character.Task.ClearAllImmediately();
    Player.Character.Task.PlayAnimation(beggarsitting, "beggar_beg", 8);
    gmoney.Start();
    while (bp == true) Wait(0);
    Player.Character.Task.ClearAllImmediately();
    Player.Character.Task.PlayAnimation(beggarsitting, "beggar_sit", 8,AnimationFlags.Unknown05);
    if(Player.Character.isDead)
    cleanup();
    if(e.Command == "t_beggar" && tb == true)
    cleanup();
    public void msg(string sMsg, int time)
    Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", new Parameter[] { "STRING", sMsg, time, 1 });
    public void beg_playing()
    if (GTA.Native.Function.Call<bool>("IS_CHAR_PLAYING_ANIM", Player.Character, "amb@beg_sitting", "beggar_beg") == false)
    bp = false;
    if (GTA.Native.Function.Call<bool>("IS_CHAR_PLAYING_ANIM", Player.Character, "amb@beg_sitting", "beggar_beg") == true)
    bp = true;
    public void cleanup()
    tb = false;
    gmoney.Stop();
    Every time i run the game i get "Error in Constructor" and "Object reference not set to an instance of an object"

    please verify 
    this.Interval = 100000;
    Interval, member of the class or no ?
    Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP]

Maybe you are looking for