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


hi, have as3 script calls xml when compiling error

 

referenceerror: error #1056: cannot create property 0 on number.
@ mod::ml/parsedata()
@ mng::dm/onxmlloaded()

here snippets

 

the first script defines xml

 

        private function addedtostagehandler(event:event = null) : void
        {
            var _loc_2:* = application.getinstance();
            application.xmlpath = "xml/soc.xml";
            _loc_2.initialize(this);
            return;
        }

 

here ml one

 

    public class model extends eventdispatcher implements imodel
    {
        public var social:social;

        public function model()
        {
            return;
        }

 

        public function parsesocialdata(param1:xml) : void
        {
            this.social = new social(param1);
            this.socialsection.social = this.social;
            return;
        }

        public function getsectiondata(param1:string) : absec

        {
            var _loc_2:absec = null;
            switch(param1)
                case "socialsection":
                {
                    _loc_2 = this.socialsection;
                    break;
                }

            return _loc_2;

        }

 

        public function parsedata(param1:xml) : void
        {

            this.socialsection = new socialsection(xml(_loc_3));
            var _loc_4:int = 0;
            var _loc_5:* = xml.sections.section;
            var _loc_3:* = new xmllist("");
            each (_loc_6 in _loc_5)
            {
               
                var _loc_7:* = _loc_5[_loc_4];
                (_loc_5[_loc_4])
                {
                    if (@id == "socialsection")
                    {
                        _loc_3[_loc_4] = _loc_6;
                    }
                }
            }

         }

 

 

here dm one

        private function onxmlloaded(event:event) : void
        {
            var _loc_2:* = new xml(event.target.data);
            this.model.parsedata(_loc_2);
            dispatchevent(new event(xml_loaded));
            return;
        }

and xml

 

  <section id="socialsection" active="true" visible="true" default="false">
   <name><![cdata[<font size="50">social</font>]]></name>
   <title><![cdata[<font size="25">social</font>]]></title>
   <forums>
    <line1><![cdata[<font size="10">post on the</font>]]></line1>
    <line2><![cdata[<font size="18">forums</font>]]></line2>
    <rollover><![cdata[<font size="10">have questions? click here.</font>]]></rollover>
    <url>link_to_forum</url>
   </forums>
  </section>

 

i think issue _loc_4 not sure how fix this. thanks!

click file/publish settings/flash , tick "permit debugging".  retest.  problematic line number in error message.



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Hur installera Joomla på One.com - Joomla! Forum - community, help and support

removing index.php from URL address - Joomla! Forum - community, help and support

「イメージマップのアンカー名には、...」のエラーが出ないようにしたい