RefrenceError: Error #1056

Hello

I'm trying to assign a number to a property of object and I get the following error:

ReferenceError: Error #1056: cannot create the choice of the property to the string. .. Main.as:791 .in

Line 791 is: customClass.redirectionUnre.choice = 2;

Before I try to replace the property, it is a string ('2' instead of 2). Is how important it? If so, should what solution I use?

unless your customClass instance is a singleton, you probably use the customClass various bodies to set redirectionUnre.

Tags: Adobe Animate

Similar Questions

  • ReferenceError: Error #1056: cannot create the title to the number.

    I have some problem with a table in one of my classes.

    Here are the details:

    JsonApi.as - my JSON class library and support wrapper functions for use with a Web service API.

    This is the skeleton of this file:

    (declaration of the class and constructor variables)

    // class variables
        static var apiRoot:String = "HTTP://";
        static var apiKey:String = "";
    
        public var MyArray:Array;
    
        public function QAPI()
        {
    
            trace("JsonApi => Constructor Called!");
    
        }
    

    the problematic function

    private function onComplete(e:Event){
    
     trace("JsonApi (onComplete) => Alive!");
     MyArray = new Array();
     trace("JsonApi (onComplete) => Array Made!");
    
     // get the data from the loader
     var loader:URLLoader = URLLoader(e.target);
    
     // we get errors here, so instead of Array type, must call it Object type
    
     var qData:Object = JSON.decode(loader.data, false);
    
    // for debugging, go through arrays to get the info we need
        for (var j:String in qData['items']) {
    
        trace("JsonApi (parsing) --> J is now: " + j );
    
        // get the ID from the sub array
        this.MyArray['id'] = qData['items'][j]['id'];
    
        // then fill in the rest of the data
        this.MyArray['id']['title'] = qData['items'][j]['title'];
        this.MyArray['id']['creator']  = qData['items'][j]['creator'];
        this.MyArray['id']['term_count']  = qData['items'][j]['term_count'];
        this.MyArray['id']['has_images'] = qData['items'][j]['has_images'];
    
        }
    }
    

    Now I forgot the code of this function which plots the data in the table of qData, but I know qData table is valid and that it has the information I need.

    My problem is the following:

    Error #1056: Cannot create property title on Number.
    

    that occurs on this line:

    this.MyArray['id']['title'] = qData['items'][j]['title'];
    

    I have google would be around, but cant figure try it as Google results say it has to do with the attempt to write in a private variable.  If you look at the decleration of class variable, you can see that I explicitly did PUBLIC.

    Please help me!

    (Thanks!)

    Hey,.

    I don't think you saw my second edition. Here is the code:

    private function onComplete(e:Event){
    
     trace("JsonApi (onComplete) => Alive!"); MyArray = new Array(); trace("JsonApi (onComplete) => Array Made!");
    
     // get the data from the loader var loader:URLLoader = URLLoader(e.target);
    
     // we get errors here, so instead of Array type, must call it Object type
    
     var qData:Object = JSON.decode(loader.data, false);
    
    // for debugging, go through arrays to get the info we need for (var j:String in qData['items']) {
    
      trace("JsonApi (parsing) --> J is now: " + j );
    
      // get the ID from the sub array  var id:int = qData['items'][j]['id']; this.MyArray[id] = new Object();   // then fill in the rest of the data  this.MyArray[id]['title'] = qData['items'][j]['title'];  this.MyArray[id]['creator']  = qData['items'][j]['creator']; this.MyArray[id]['term_count']  = qData['items'][j]['term_count'];   this.MyArray[id]['has_images'] = qData['items'][j]['has_images'];
    
      }}
    

    Copy and paste what it is and see if you get any change in the result. you always use the id as a string but use as the variable id with no quotes and remember to set up the table to a new object, so there dynamic fields. Good luck!

  • ReferenceError: Error #1056: cannot create gameOverMenu property on game. -pls help :(

    ReferenceError: Error #1056: cannot create gameOverMenu property on game.

    at flash.display::Sprite/constructChildren()

    at flash.display::Sprite()

    at flash.display::MovieClip()

    at Game()***************************:16]

    Cannot display the source code at this location.

    ~~~~~~~~~~~~~~~~

    Code Game.As:

    package {}

    import flash.display.MovieClip;

    import flash.events.Event;

    import flash.utils.Timer;

    import flash.text.TextField;

    import flash.text.TextFormat;

    Game/public class extends MovieClip {}

    public static var character: MovieClip;

    public static var enemyTimer:Timer;

    public static var scoreText:TextField;

    public static var score: Number;

    public static var healthMeter:HealthMeter;

    public static var gameOverMenu:GameOverMenu;

    public void Game() {}

    Key.Initialize (internship);

    character = new Character();

    addChild (character);

    enemyTimer = new Timer (1000);

    enemyTimer.addEventListener ("timer", sendEnemy);

    enemyTimer.start ();

    var scoreFormat = new TextFormat ("Alexandrian MS", 20, 0xFFFFFF);

    scoreText = new TextField();

    scoreText.defaultTextFormat = scoreFormat;

    scoreText.x = 290;

    scoreText.text is a String (0);.

    addChild (scoreText);

    healthMeter = new HealthMeter();

    addChild (healthMeter);

    healthMeter.x = 10;

    healthMeter.y = 10;

    gameOverMenu = new GameOverMenu();

    gameOverMenu.x = 300;

    gameOverMenu.y = 150;

    addChild (gameOverMenu);

    gameOverMenu.visible = false;

    gameOverMenu.playAgainButton.addEventListener ("mouseDown", newGame);

    resetScore();

    }

    function sendEnemy (e: Event) {}

    enemy of the var = new Enemy();

    stage.addChild (enemy);

    }

    public static function updateScore (points) {}

    score +=;

    scoreText.text = String (score);

    }

    public static function resetScore() {}

    score = 0;

    scoreText.text = String (score);

    }

    function newGame (e: Event) {}

    gameOverMenu.visible = false;

    Character.Visible = true;

    Character.x = 300;

    Character.y = 150;

    character.takeDamage(-character.maxHealth);

    character.addEventListener ("enterFrame", character.move);

    resetScore();

    enemyTimer.start ();

    }

    public static function gameOver() {}

    gameOverMenu.visible = true;

    enemyTimer.stop ();

    for (var i in Enemy.list) {}

    Enemy.list [i]. Kill();

    }

    }

    }

    }

    I don't see a problem with your code, but, of course, I can't tell if you really have a class named GameOverMenu in your class path.  and I see no reason for all static variables/functions.

  • Error #1056: Could not create property 0 String.

    I found similar to this subject positions but could not find my situation.

    I have 2 tables, one is filled earlier in the program by entries of the user in the following format:

    VideoArray [0]: Nothing

    VideoArray [1]: [object]

    VideoArray [1] [0]: String (this string is registration by the user in a text field)

    VideoArray [1] [1]: String (this string is registration by the user in a text field)

    Then, it follows the pattern of user input:

    [2]: object

    [2] [0]: string

    [2] [1]: string

    [3]

    [3] [0]

    [3] [1]

    ... Repeat for as long as the user enters data.

    I try to copy the data in another table by using a series of loops since I won't know how many sets of data from user input. I need not the object data in the new table. The new array (InfoArray) will be structured as follows:

    InfoArray [0]: String

    InfoArray [1]: number

    InfoArray [2]: Nothing

    InfoArray [2] [0]: VideoArray [1] [0]

    InfoArray [2] [1]: VideoArray [1] [1]

    InfoArray [3] [0]: VideoArray [2] [0]

    InfoArray [3] [1]: VideoArray [2] [1]

    .. Repeat until all the data is copied.

    I do this with the following:


    ArrayCount = VideoArray.length + QuestionArray.length + 2



    for (var i: int = 0; i < = ArrayCount; i ++)



    {




    If (i == 0)




    {





    InfoArray [i] = ModuleName;




    } else




    {





    If (I == 1)






    {







    InfoArray [i] = Number_Of_Videos;





    } else






    {







    If (I < = Number_Of_Videos + 2)






    {







    InfoArray [i] = [];






    for (var j: int = 0; j < = 1; j ++)






    {







    trace ("I =" + i);






    trace ("j =" + j);






    trace ("VideoArray [i-1] [j]:" + VideoArray [i-1] [j]);






    InfoArray [i] = ' video: '; "
    Line 272




    InfoArray [i] [j] is VideoArray [i-1] [j];.





    }





    } else






    {

    (don't know why he copied the code like this, I couldn't find a button "Insert code")

    When I run it, I get my tracks and the error:

    I have = 2

    j = 0

    VideoArray [i-1] [j]: v1

    ReferenceError: Error #1056: cannot create property 0 String.

    at BWSModuleGenerator_fla::MainTimeline/Compile_Info() [BWSModuleGenerator_fla. [MainTimeline: frame1:272]

    Ive never gotten this error before and im not sure what is wrong with my code.

    Thanks for any help.

    It's a little confusing trying to follow your data storage scheme and that could be a big part of the problem, but for two lines show you...

    InfoArray [i] = ' video: '; "

    InfoArray [i] [j] is VideoArray [i-1] [j];.

    If the first is a string, the second cannot be an element of a table if that is the intention.  It seems that the compiler considers to try to target a property from a string using the notation of support where the [j] at the end is interpreted as a property, not an index of an array.

  • Error 1056 and image on top of image problem

    I'm trying to put a button on the screen and rotate when mouse_over (which will be one of the buttons of mutiple with different instance names.) The code I wrote is to put 2 colorwheels on the screen, one above the other, I can see the bottom turn, but I can't seem to understand why he is the top.

    But then, I get an error code message 1056 with no compilation error when I smile on the dial: ReferenceError: Error #1056: cannot create builtin.as$ 0.MethodClosure rotation property.
    to fl.transitions::Tween/setPosition()
    to fl.transitions::Tween / set position()
    to fl.transitions::Tween()
    to Colorwheel / rotateKids)

    I am fairly new to as3 so thanks for your patience!  I tried to figure this out for days!  I guess I have to import a class, but don't know what.

    Here is my code

    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;
    import flash.events.Event;

    static_mc. Play();

    var kids_btn = new Cwcopy_mc;
    addChild (kids_btn);
    kids_btn.x = 745,1;
    kids_btn.y = 122.2;
    kids_btn. Height = 100;
    kids_btn. Width = 100;
    kids_btn.addEventListener (MouseEvent.MOUSE_OVER, rotateKids);
    function rotateKids(e:MouseEvent):void {}
    var spin: Tween = new Tween (rotateKids, "rotation", Strong.easeInOut, 0, 360, 5, true);
    }

    You must specify the target object in the Tween code, not the function call...

    var spin: Tween = new Tween (kids_btn, "rotation", Strong.easeInOut, 0, 360, 5, true);

    Once you change it, see what other kicks, if anything.

  • Working Cocomo/CAA app now survey error #1056

    See below the detailed error - ideas?

    Thank you

    Rick

    =================

    ReferenceError: Error #1056: cannot create isRTMFP of the com.adobe.rtc.sharedManagers.descriptors.UserDescriptor property.
    at com.adobe.rtc.sharedManagers::UserManager/onSynchronizationChange() [C:\work\main\connect\ cocomo\src\com\adobe\rtc\sharedManagers\UserManager.as:765]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    to com.adobe.rtc.sharedModel::CollectionNode/ http://www.adobe.com/2006/connect/cocomo/messaging/internal:setIsSynchronized () [C:\work\m ain\connect\cocomo\src\com\adobe\rtc\sharedModel\CollectionNode.as:664 ]
    at com.adobe.rtc.messaging.manager::MessageManager/receiveAllSynchData() [C:\work\main\connec t\cocomoPlayer10\src\com\adobe\rtc\messaging\manager\MessageManager.as:783]
    to com.adobe.rtc.messaging.manager::MessageManager/ http://www.adobe.com/2006/connect/cocomo/messaging/internal:receiveItems () [C:\work\main\c onnect\cocomoPlayer10\src\com\adobe\rtc\messaging\manager\MessageManager.as:539 ]
    at com.adobe.rtc.session.managers::SessionManagerBase/receiveItems() [C:\work\main\connect\co comoPlayer10\src\com\adobe\rtc\session\managers\SessionManagerBase.as:374]

    Figured it out. Mixed references to the new swf AFCS and the old swf Cocomo.

  • ReferenceError: Error #1056:

    We get this error when this class is instantiated. It is implemented in my FLA as the document class:

    ReferenceError: Error #1056: cannot create tab0 property classes.tagwidget.TagWidget.
    at classes.tagwidget::TagWidget/::addTabs()
    at classes.tagwidget::TagWidget$iinit()

    You must declare your dynamic class:

    / public dynamic class TagWidget extends MovieClip
    {
    }

  • set executeInBackground = true on iOS cannot create property error

    I use Flash Builder 4.7, created a Flex Mobile project.

    When my application are disabled, he must send an HTTP POSt request to my server. It takes a few milliseconds to send and on Android, it works fine. However, on iOS, as the application is paused, the request is not sent until I activate the application again.

    I looked online and tried this solution:

    adding the line

    NativeApplication.nativeApplication.executeInBackground = true;

    Depending on the House, or just before sending the application throws an exception:

    ReferenceError: Error #1056: cannot create flash.desktop.NativeApplication property executeInBackground.

    views: BnpSampleHomeView$ cinit)

    Global $init)

    at BnpSample() [C:\eclipse\projects\BnpSample\src\BnpSample.mxml:3]

    to _BnpSample_mx_managers_SystemManager / create () [_BnpSample_mx_managers_SystemManager.as:51]

    at mx.managers.systemClasses::ChildManager/initializeTopLevelWindow() [E:\dev\4.y\frameworks\ projects\framework\src\mx\managers\systemClasses\ChildManager.as:311]

    at mx.managers::SystemManager/initializeTopLevelWindow() [E:\dev\4.y\frameworks\projects\fram ework\src\mx\managers\SystemManager.as:3057]

    to mx.managers::SystemManager / http://www.Adobe.com/2006/Flex/MX/internal:kickOff ([E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2843])

    to mx.managers::SystemManager / http://www.Adobe.com/2006/Flex/MX/internal:preloader_completeHandler ([E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2723])

    at flash.events::EventDispatcher/dispatchEventFunction()

    at flash.events::EventDispatcher/dispatchEvent()

    at mx.preloaders::Preloader/timerHandler() [E:\dev\4.y\frameworks\projects\framework\src\mx\p reloaders\Preloader.as:542]

    at flash.utils::Timer/_timerDispatch()

    at flash.utils::Timer/tick()

    Help is apprecaited

    Some parts of this section may be useful:

    http://forums.Adobe.com/message/4359474

  • MovieClip compilation error

    Good evening

    Sorry for a newbie question, but that's what I am!  I'm trying to create a unique image clip that contains 3 dynamic text fields.  In the MovieClip class, I need to change the content and format of text fields.  My code has no syntax errors, but it does not compile.   Here is my code:

    package
    {

    import flash.display.MovieClip;
    Import fl.controls.TextArea;
    import flash.text.TextField;

    SerializableAttribute public class FactProblem extends MovieClip
    {
    private var txtT1:String = "a";
    private var txtT2:String = 'b ';.
    private var txtT3:String = 'c ';
    private var locX:Number = 20;
    private var locY:Number = 20;
    private var t1:TextArea;
    private var t1:TextField;

    public void FactProblem()
    {
    (IT)
    {
    x = locX;
    y = locY;
    T1. Text = txtT1;
    T2. Text = txtT2;
    T3. Text = txtT3;
    }
    }
    }
    }

    As you can see in my code, I tried to import TextArea and TextField, but the problem persists.  as the code exists, this is the error message:

    ReferenceError: Error #1056: cannot create property t1 FactProblem.
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at FactProblem()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()

    Your suggestions would be greatly appreciated.  For the last three days I was not blinking; I was stumbling in the dark!

    You are welcome.

  • Lance error on UserDescriptor class after the upgrade.

    I downloaded and respected and I get this error message.

    ReferenceError: Error #1056: cannot create isPeer of the com.adobe.rtc.sharedManagers.descriptors.UserDescriptor property.

    to com.adobe.rtc.sharedManagers.descriptors::UserDescriptor/readValueObject() [/Applications/ Adobe Flex Builder 3/plugins/com.adobe.afcs/src/com/adobe/rtc/sharedManagers/descriptors/UserDescriptor.as:1 55]

    to com.adobe.rtc.sharedManagers::UserManager/readUserDesc() [/ Applications/Adobe Flex Builder 3/plugins/com.adobe.afcs/src/com/adobe/rtc/sharedManagers/UserManager.as:1071]

    to com.adobe.rtc.sharedManagers::UserManager/userReceivedOrEdited() [/ Applications/Adobe Flex Builder 3/plugins/com.adobe.afcs/src/com/adobe/rtc/sharedManagers/UserManager.as:898]

    to com.adobe.rtc.sharedManagers::UserManager/onItemReceive() [/ Applications/Adobe Flex Builder 3/plugins/com.adobe.afcs/src/com/adobe/rtc/sharedManagers/UserManager.as:809]

    to::EventDispatcher/dispatchEventFunction() flash.events

    to::EventDispatcher/dispatchEvent() flash.events

    to com.adobe.rtc.sharedModel::CollectionNode/http://www.adobe.com/2006/connect/cocomo/messaging/internal:receiveItem () [/ Applications / a dobe 3/plugins/com.adobe.afcs/src/com/adobe/rtc/sharedModel/CollectionNode.as:745 Flex Builder]

    to com.adobe.rtc.messaging.manager::MessageManager/http://www.adobe.com/2006/connect/cocomo/messaging/internal:receiveItem () [/ Applications / a dobe 3/plugins/com.adobe.afcs/src/com/adobe/rtc/messaging/manager/MessageManager.as:662 Flex Builder]

    to com.adobe.rtc.messaging.manager::MessageManager/http://www.adobe.com/2006/connect/cocomo/messaging/internal:receiveItems () [/Applications/ Adobe 3/plugins/com.adobe.afcs/src/com/adobe/rtc/messaging/manager/MessageManager.as:537 Flex Builder]

    to com.adobe.rtc.session.managers::SessionManagerBase/receiveItems() [/ Applications/Adobe Flex Builder 3/plugins/com.adobe.afcs/src/com/adobe/rtc/session/managers/SessionManagerBase.as:373]

    Any idea?
    Thank you
    BaBo,

    Hello

    This is an error that occurs when you have multiple instances in a piece on the 9 player and player 10 running at the same time. You have applications based on 9 player and player 10 by all means, at the same time?

    This error has been corrected on our side and will soon be updated in a drop of the sdk.

    Thank you

    Hironmay Basu

  • inherit from the array class

    Hi, I want to create my array class that extends the functionality of the base table.

    I wrote something like this:

    package {}

    public class my_array extends {Array

    // (...)

    public void my_array(_long:int) {}

    // (...)

    Super (_long);

    }

    } / / class

    } / / packages

    in other words, I have to call the super constructor, and since then I declare a new table I Specifies the length of the array, I pass the length of the array to the super constructor.

    Nothing wrong so far, but when I try to use my new table, like this:

    var test: my_array = new my_array (10);

    test [0] = 1;

    I get this error:

    ReferenceError: Error #1056: cannot create 0 my_array property.

    at rob1_fla::MainTimeline/frame1()

    Then I replaced the 'super' line in the constructor of my class with this one:

    This super = (_long);

    and now I get this:

    1050: impossible to assign a value without reference.

    so, how to extend the class array, so I can use my new class of array indexes?

    TNX

    Make your class dyanamic.

  • text in table fields

    I'm trying to do a Hangman style game.i have 33 on my stage like that dynamic text fields.

    I've analyzed all the fields of text line-by-line in the 3 tables.

    I also analyzed my 3 words in 3 tables with the split method so I can check later if the letter that the selected user exists.

    in the section when the game starts and the user selects a letter that I can check if the letter exists in my first word table cannot display it on current textfield on my stage.

    I get the following error: ReferenceError: Error #1056: cannot create text String property.

    I guess when I analyzed the textfields into tables, they have gotten automatically channels. And I can't do for example:

    firstwordarray is the table where I analyzed my first word with the split method.

    letterchosentxt is the textfield when the user selects a letter.

    firstArray is the table where I analyzed the first row (11) of the text fields.

    for (var p:uint = 0; p < firstwordarray.length; ++ p)

    {

    If (letterchosentxt. Text is firstwordarray [p])

    {

    firstArray [p] .text = letterchosentxt.text;

    break;

    }

    }

    Thanks in advance.

    Yes, because you not assign the textfields but only their text property (these are two different things)

    However, you could put a textfield named "textfield1" in a table

    either with:

    Array.push (TextField1)

    or with

    Array [0] = textfield1

    It is important to mention that put a displayobject into a table, does nothing visibly to the displayobject, but only provides a method to easily reference.

  • Problem of Sprite / constructChildren)

    Hello

    I have two FLA files: in.fla and a.fla


    a.fla has two symbols: symbole1 and Symbol2

    Symbol2 is added to the symbole1

    Name of the instance of Symbol2 is "s2".

    The two symbols that I exported to the run-time shared library

    In the first image of a.fla , I wrote:

    --------------------------------------------------------------

    import flash.display.MovieClip;

    var s1:MovieClip = new symbole1;

    trace (s1.s2, "is the track of a.fla");

    --------------------------------------------------------------

    If I test a.fla now output I see: [object Symbol2] it's route of a.fla


    Next:

    In.fla I import these two symbols for her

    The importation of CFCS from a.fla to this one

    then write code in frame 1:

    var l:Loader = new Loader;

    l.contentLoaderInfo.addEventListener (Event.COMPLETE, c);

    l.Load (new URLRequest ('a.swf'));

    function c(e:Event):void {}

    new symbole1;

    }

    When I test in.fla output I see: [object Symbol2] it's route of a.fla

    If everything works well until now.

    But if I change definition for symbole1 in a.fla of the class and then save it as Symbol1.as:

    When I test a.fla nothing has changed

    But in.fla gives me an error:

    ReferenceError: Error #1056: cannot create property s2 symbole1.

    at flash.display::Sprite/constructChildren()

    at flash.display::Sprite()

    at flash.display::MovieClip()

    at Symbol1()

    at a_fla::MainTimeline/frame1()

    ReferenceError: Error #1056: cannot create property s2 symbole1.

    at flash.display::Sprite/constructChildren()

    at flash.display::Sprite()

    at flash.display::MovieClip()

    at Symbol1()

    at in_fla::MainTimeline/c()

    What's wrong?

    PS. If the error disappears in a.fla in instance name to delete symbole1 to Symbol2;

    No, use:

    new Symbol1();

    :

    var loader: Loader = new Loader();

    var context: LoaderContext = new LoaderContext();

    context.applicationDomain = ApplicationDomain.currentDomain;

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, loadcompleteF);

    Loader.Load (new URLRequest ("a.swf"), context);

    function loadcompleteF(e:Event):void {}

    var ClassRef: Class = getDefinitionByName ("Symbol1") in class;

    var it: * = new ClassRef();

    trace (ci);

    }

  • Get a picture of a multi-dimentional array in a function

    Don't know how to explain it, but here, first of all, I can't go beyond. Also had this problem with anything else I've tried.

    ReferenceError: Error #1056: Cannot create property 0 on Number.
    

    I googled and found on about automatically declare instances of point, which was very good, I had the box checked.

    Basically, he is unable to even the simplest. I have this function:

    function getInfoOf(i) { // enemy count, info count
    
        var _info:Array = new Array(3, 6); 
        // 0 is you
        _info[0,Const.MAXHP] = 500;
        _info[0,Const.CURRENTHP] = 500;
        _info[0,Const.LEVEL] = 5;
        _info[0,Const.EXP] = 5500;
        _info[0,Const.NAME] = "You";
        _info[0,Const.LINKEDMC] = "NONE";
        // then a few more _info's.
    }
    
    

    Then I didn't try everything in their power to operate, it stripped so no return. In the code, in the init() of the project part (called once only), so getInfoOf (0) and tried all the other numbers. I get this error and cannot for the life of me find out what's wrong (I also tested the 'Const'. they are integers, and I tested using numbers instead of those.) Still the same error, it only disappears I does not call the function at all.

    Any help would be greatly appreciated.

    Thank you.

    Post edited by: brokenhope The table is actually (3.6), which has messed up.

    Once again, to access an array element (for example, the last), use:

    _info [2], [5] = "whatever";

    NOT

        info[0,5] = 0;

  • Import CSV file and the conversion of an array

    Hi all

    I'm working on a site that is to import a CSV (comma separated values) published via actionscript 3.0 URLloader().  Now I just try to get actionscript to successfully enter the data imported from the CSV file as a table, then the CSV file has 1 single cell that contains "athleticMaroon, charcoal, colonialBlue, kellyGreen, fullColor".

    Here is the code I use:

    create table

    var shirtLiveIntense_btn_Colors:Array = new Array();

    run the import from CSV data

    URLLoaderCSV();

    shirtLiveIntense_btn.addEventListener (MouseEvent.CLICK, selectingLogo);

    function selectingLogo(e:MouseEvent):void {}

    trace ("current logo');

    var colorButtons:Array = this [e.currentTarget.name + "_Colors"];

    for (var i: uint = 0; i < colorButtons.length; i ++) {}

    .Ivar colorButtons [i] = i;

    colorButtons [i] .addEventListener (MouseEvent.CLICK, shirtColorOption);

    }

    }

    CSV data import function

    function URLLoaderCSV() {}

    var loader: URLLoader = new URLLoader();

    configureListeners (loader);

    var request: URLRequest = new URLRequest ("https://docs.google.com/spreadsheet/pub?hl=en_US & hl = en_US & key = 0AlJnOKOffTSxdFk0RVlEUTVHeF9 DMHZfZ0JzSkJjZFE & single = true & gid = 1 & output = csv");

    try {}

    Loader.Load (request);

    } catch (error: Error) {}

    trace ("unable to load requested document.");

    }

    }

    function configureListeners(dispatcher:IEventDispatcher):void {}

    dispatcher.addEventListener (Event.COMPLETE, completeHandler);

    dispatcher.addEventListener (Event.OPEN, openHandler);

    dispatcher.addEventListener (ProgressEvent.PROGRESS, progressHandler);

    dispatcher.addEventListener (SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);

    dispatcher.addEventListener (HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);

    dispatcher.addEventListener (IOErrorEvent.IO_ERROR, ioErrorHandler);

    }

    function completeHandler(event:Event):void {}

    var loader: URLLoader = URLLoader (event.target);

    trace ("completeHandler:" + loader.data);

    shirtLiveIntense_btn_Colors.push (loader.data);

    }

    function openHandler(event:Event):void {}

    trace ("openHandler:" + event);

    }

    function progressHandler(event:ProgressEvent):void {}

    trace ("progressHandler loaded:" + event.bytesLoaded + "total:" + event.bytesTotal);

    }

    function securityErrorHandler(event:SecurityErrorEvent):void {}

    trace ("securityErrorHandler:" + event);

    }

    function httpStatusHandler(event:HTTPStatusEvent):void {}

    trace ("httpStatusHandler:" + event);

    }

    function ioErrorHandler(event:IOErrorEvent):void {}

    trace ("ioErrorHandler:" + event);

    }

    Here is the result:

    openHandler: [event type = "open" bubbles = false cancelable = false eventPhase = 2]

    progressHandler loaded: 57 total: 0

    httpStatusHandler: [HTTPStatusEvent type = "httpStatus" bubbles = false cancelable = false eventPhase = 2 status = 200]

    completeHandler: athleticMaroon, colonialBlue, kellyGreen, charcoal, fullColor

    chosen logo

    ReferenceError: Error #1056: cannot create ivar String property.

    at main_fla::MainTimeline/selectingLogo()

    Review of results of release, I see it's clearly to load the data from the CSV file correctly, but what I think it does is important data as a single string, aka 'athleticMaroon, charcoal, colonialBlue, kellyGreen, fullColor' and push for shirtLiveIntense_btn_Colors:Array = new Array().  But, as I see the error selectingLogo(e:MouseEvent) service cannot treat the table because it contains a string of.

    If I switch to shirtLiveIntense_btn_Colors.push (loader.data); with shirtLiveIntense_btn_Colors.push (charcoal, colonialBlue, kellyGreen, athleticMaroon, fullColor); everything works like a charm, but I need the table to assign dynamic in the CSV file data

    Can anyone help to get imported CSV data to strings pushed a table accessible?

    Thank you!


    It is an error caused by:

    var colorButtons:Array = this [e.currentTarget.name + "_Colors"];

    for (var i: uint = 0; i

    .Ivar colorButtons [i] = i;

    colorButtons [i] .addEventListener (MouseEvent.CLICK, shirtColorOption);

    }

    your table is an array of strings.  If you try to force these strings into objects on the timeline that contains your code, use array notation:

    var colorButtons:Array = this [e.currentTarget.name + "_Colors"];

    for (var i: uint = 0; i

    This .ivar [colorButtons [i]] = i;

    This [colorButtons [i]] .addEventListener (MouseEvent.CLICK, shirtColorOption);

    }

Maybe you are looking for