There’s a lot of stuff missing it seems in your class. AS3 is strong-type coding, so you need to code in everything you’re assuming it understands. I don’t have the time to check it out, but my first guess is to have the set/get commands and call the splice/push methods on the actual array (maybe using “this” – think in AS2 to AS3 the implementation of “this” changed).

_________________________________________

Jonathan Miranda

Flexible Master of the Web

"In the game of chess, it's important to never let your opponent see your pieces."

HealthGrades: Guiding America to Better Healthcare™

NASDAQ: HGRD

w  (720) 963-3832

c  (707) 761-0868

[EMAIL PROTECTED]

_________________________________________

The message contains confidential and/or legally privileged information and is intended for use only by the indicated addressee.  If you are not the named addressee you should not disseminate, distribute, or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmissions cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed,arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Vadim Melnik
Sent: Monday, February 27, 2006 1:50 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Array based class throws error for splice method call

 

Hi All,

Got problem with my custom class inheriting default AS3 Array one.
Not sure it's allowed in AS3, but it worked well with previous
ActionScript 2.

I've created small test case, it throws runtime error somewhere
inside Array.splice call. Also in real application I am getting IE
GPFs right after exception dialog closed.

P.S.: also reported this bug using web form -
http://www.macromedia.com/cfusion/mmform/index.cfm?name=wishform


[Error]

ReferenceError: Error #1069: Property length not found on MyArray
and there is no default value
      at Array/splice()
      at MyArray/bug()
      at test002::doTest()

[test002.mxml]

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml"
>
<mx:Button click="doTest()" label="doTest"/>
<mx:Script><![CDATA[

import MyArray;

private function doTest():void
{
      var a:MyArray = new MyArray();
      a.bug();
}

]]></mx:Script>
</mx:Application>


[MyArray.as]

package
{
      public class MyArray extends Array
      {
            public function MyArray()
            {
                  push("some data");
            }

            public function bug():void
            {
                  splice(0, 1);
            }
      }
}



--
Thanks,
Vadim.






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to