Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Public Class ArrayEx Extends Array



Hi, I'm very bad at OO programming, but I'm trying to learn. I want to add some functions to my Arrays, like checking if arrays contain a value (indexOf can be equal to 0, which is false, though actually I'm used to the loose data typing of as2, so this may not be quite true. Bear with me though, I want to learn how to extend a class). So I'm trying to write a class that extends the basic Array class.I am confused about the constructor, I want to mimic the behaviour of the Array class but I'm not sure if I need to write functions for each method of Array. Since my ArrayEx extends the Array class it should inherit the array functions right? So it should already have .pop() and .push() ext. defined? How should I write my constructor to store the data the same way as the Array class does though? Is there somewhere I can look at the internal Array class to figure out how it does it?What I have written so far appears at the bottom of the message. I include questions as comments.I hope someone can help me out. I'm sorry if I'm asking stuff that seems obvious. Thanks for your time.JonAttach Codepackage {//should I import the Array function here? Surely its always accessable?public class ArrayEx extends Array{// do i need "private var myArray:Array;"?public function ArrayEx(...statements){if(if statements.length == 1 && statements[0] is uint){////myArray(statements); how should this Array mimic the original Array class?}else{//myArray(statements); see above}}}}



Adobe > ActionScript 3
Posted on: 05/18/2008 08:55:20 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Populate Class That Extends Array?
Hi!

Ok, I want a class that extends an array, and populates itself with named key values. Like this:

var array:CustomArray = new CustomArray();
trace(array['a']); // Outputs 'Hello World!'

But, writing this['a'] = 'Hello World!' inside the CustomArray class does not work, obviously.

I'm sure I can think of a workaround, but let's just say I want it like this, how do I do it? How do I create the 'a' key inside the CustomArray class and assign a value to it?

/ Frank

[F8] Public Array In Class
Hi am begining with some AS2.

In this class i have declared a public var locName:Array;

But i m not able to access it down inside the code. when i try to use, it always shows undefined.



Code:
class MainInterface {
public var lessonId:Number;
public var lessonTitle:Number;
public var locName:Array;
public var locUrl:Array;

public function MainInterface() {
locName = new Array();
locUrl = new Array();
var mainXml = new XML();
mainXml.ignoreWhite = true;
mainXml.onLoad = function(success) {
if (success) {
var mainNode = mainXml.firstChild;
lessonId = mainNode.attributes.id;
if (mainNode.childNodes[0].localName == "title") {
lessonTitle = String(mainNode.childNodes[0].localName);
}
if (mainNode.childNodes[1].localName == "locations") {
var tempNodes = mainNode.childNodes[1].childNodes;
for (var i = 0; i<tempNodes.length; i++) {
locName[i] = tempNodes[i].attributes.name.toString();
locUrl[i] = tempNodes[i].attributes.url.toString();
}
trace(locName)
}
}
};
mainXml.load("lesson.xml");
}
}
Plz Help. Also I m not able to get the access of this array in this other functions of this access after filling the values

AS3 - Extends MovieClip And Public Function Set Width
Hi,

I'm trying to create a class which extends MovieClip and for my needs I need to introduce a setter function so I can have my private variable, _width, controlled for later uses.

As always, the setter function looks like this.

public function set width(newWidth:Number):void
{
_width = newWidth;
}

but the problem is that because I am extending the MoviClip class, it does not allow me to set the width like this!

I know I may be able to work around this by changing the name of "width" to anything else like "myWidth" But I'm posting this to see if there's another way so that I can use the width anyway? and still extends the MovieClip to use it's properties?

Any advice is appriciated,
Hadi

AS3 Project In FDT + Flex SDK. Root Class Extends Visual Class From Swc
hello
question about compiling as3 project under FDT 3.0 with Flex SDK.

I want my main root class to contain some graphics already at the start. In Flash IDE I put some objects on the stage, make new symbol with all those objects inside, set linkage to MainClassGraphics, export it to swc, add this swc to source folder class-path. Then I write my root class:

Code:
package {

public class MainClass extends MainClassGraphics {
public function MainClass() {
trace('hey');
}
}
}

compiling with flex2 sdk - and I don't see any graphics. why?

if i try this way:

Code:
package {
import flash.display.Sprite;

public class MainClass extends Sprite {
public function MainClass() {
var s:Sprite = new MainClassGraphics();
addChild(s);
trace('hey');
}
}
}

then I see my graphics.. so swc looks like fine


crosspost here http://fdt.powerflasher.com/forum/vi...hp?f=21&t=2268

Class Extends XML
Hi, Can anyone tell me what is wrong with this code. Cheers

class Quiz extends XML{
function Quiz(){

}
function set_up_xml(){
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.load("xml/test_xml.xml");
my_xml.onLoad = function (success){
if(success){
trace("******* "+my_xml.firstChild);
}
}
}
}

//////////////////////////////////////////////
// FLA file
//////////////////////////////////////////////
var quiz:Quiz = new Quiz(quiz_selected);
quiz.set_up_xml();

Class App Extends Box
I hope this is the right forum for this, since this is a Flex/AS3 instead of a purely AS3 question. I couldn't find a Flex/AS forum. Anyway,

I want to use ActionScript files with Flex, which works if I have as long as I don't try to draw something, but as soon as I do.. it gives me an error (below) Any ideas? I also tried to run the drawing script on Events.ADDED, but no go.

The reason why I want to use external AS is because I am using FlashDevelop for my authoring and it does not have code hinting when writing AS inside of the <mx:Script> tag.


(I just started learning Flex/AS3 over the weekend, quite a change from AS2 )
Thank you in advance (again)


Code:
<?xml version="1.0" ?>
<!-- @mxmlc -output binApp.swf -->
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:custom="*"
width="100%" height="100%">
<custom:App width="100%" height="100%" backgroundColor="0x00ff00" />
</mx:Application>

Code:
package {
import flash.display.Sprite;
import flash.events.Event;
import mx.containers.Box;

[SWF(width="800", height="600", frameRate="31", backgroundColor="#FFFFFF")]
public class App extends Box {
public function App() {
var s:Sprite = new Sprite();
s.graphics.lineStyle(2,0xff0000);
s.graphics.drawRect(0,0,100,100);
addChild(s);
//addEventListener( Event.ADDED, init );
}
}
}

Quote:




TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Sprite@1269c91 to mx.core.IUIComponent.
at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::addingChild()
at mx.core::Container/addChildAt()
at mx.core::Container/addChild()
at App$iinit()
at mx.core::Container/createComponentFromDescriptor()
at mx.core::Container/createComponentsFromDescriptors()
at mx.core::Container/mx.core:Container::createChildren()
at mx.core::UIComponent/initialize()
at mx.core::Container/initialize()
at mx.core::Application/initialize()
at MindManager/initialize()
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::childAdded()
at mx.managers::SystemManager/::initializeTopLevelWindow()
at mx.managers::SystemManager/::docFrameHandler()

Extends More Than One Class
how I do to extend more than one class??? I would like to extend the sprite class and EventDispatcher. In my class sample open a image which works fine and addChild to the sprite, but I would like to dispatch a event as well when the image is loaded.

Thank you very much.

"class SomeClass Extends Some.path.to.Class" Causes Strange Compiler & Runtime Errors
Why is it that in AS3 when you extend a class and add the fully-qualified classpath to the "extends" bit of the class body:


ActionScript Code:
class SomeClass extends some.path.to.SomeClass

I get all sorts of strange compile and runtime errors completely unrelated to it?

One example: the compiler complains about "coercing unrelated types" when I try to declare a variable that is typed to its superclass:


ActionScript Code:
var superWidget:Widget = new SuperWidget()

BUT, when if the class is declared like so:


ActionScript Code:
class SomeClass extends SomeClass

It will be fine!

It's different from AS2, huh...


Any ideas?

Class Extends Class (in Lower Dir)
How would you extend a class that is in a lower directory?

if you had your main class in a folder: "source/sectionA"
how would you extend something from the source folder below it?

sectionA.sectionAClass extends sourceClass (would be out of scope)

shoot, does that make any sense?

Class B Extends A And Uses It Via Composition?
I am programming some textboxes including speech, thought bubbles and information callout boxes.

The most elementary box that the others extend is called TextBox. This superclass is simply an input textfield on a drawn background that can be moved and scaled onscreen. This class by the way implements an interface called IDraw, that has one or two methods in it.

PictureBox extends this class, and adds the facility to add an image, together with text that is separately moveable and scaleable within the PictureBox object.
I can use the TextBox object via composition within this class, which means PictureBox not only extends TextBox but uses it via composition.

It seems to work but is this good OOP practice?

blipstation.

Class Extends Movieclip
this code gives me an error stating that no such movie clip was found.
i guess im confused cause ive never made a class which extends movieclip before. Doesn't that mean that, the instance of the class is going to be a movie as well? Doesnt it mean that I can do whatever I do with movieclips with this class now? I can't attach a movieclip or anything like the following code inside my class.

basically I'd like to be able to attach a movieclip to my class. I don't want to attach it to root or any other movie clip on the root.

what's my problem here? what am I not getting?


ActionScript Code:
class MyClass extends MovieClip{

  function MyClass(){
    test();
  }
 
  function test(){
    this.createEmptyMovieClip("my_mc",123);
    this.my_mc._x = 300;
    this.my_mc._y = 300;
  }

}

OOP: Extends Or Composition Or Just Add On To Class
Hey,

I got this pretty neat little reflection class. I want to add some code to it that would use the MovieClip matrix filters and bend the reflection a little bit, thus adding angle.

What is the best option for OOP practices to expand on my classuses "extends Reflection" and make class ReflectionDeleux?
make a new ReflectionDelux and use composition?
or just add some extra methods in the Reflection class?

Any thoughts?

Honestly, I'd probably go extends over composition. But I'm really wondering if I should just add methods to the class that already exists or extend it. I'm not sure which is better.

Cheers.

Extends To Built In Class-- Why We Do So
Quite often in our class we write
public class MyClass extends Sprite
public class MyClass extends XMLDocument
public class MyClass extends URLLoader
etc
How does it works in get executed in our program.Basically I know extending class denotes inheritance also we can use and call fields/variables and methods
of that class from subclass.But extending built in class .Does it means the same
Than how to implement functions of built in class from subclass.
can anybody help please .Thanks in advance
With Regards
Anurag

Extends XML Build-in Class
The following is my code ...
I want the extends the XML class to my custom class(XMLReader),
But i find that i cannot get the firstChild after success load the XML .
Please help ~!
What's wrong for my coding ~!

function XMLReader() {
}
// Construct an XML object to hold the server's reply
XMLReader.prototype = new XML();
//ignore XML white space
XMLReader.prototype.ignoreWhite = true;
// this function triggers when an XML packet is received from the server.
XMLReader.prototype.load = function(success) {
if (success) {
trace("SUCCESS");
trace(this);
} else {
trace("FAILED");
}
};
XMLReader.prototype.getRoot = function() {
return super.firstChild;
};



XMLReader = new XMLReader();
XMLReader.load("http://localhost:8103/Category.xml");
trace(XMLReader.getRoot());

Class Extends Movieclip
Hello,

I have a little prob here, maybe someone can help me..

in human.as:
class human extends MovieClip {
function onEnterFrame() {
_x += 10;
}
function human() {
attachMovie("skin1", "skin1", 1);
}
}
in my fla:
Object.registerClass(skin1, human);
_root.attachMovie("skin1", "User1", 1);

so i have an attached movieclip on _root now, i can see it but the onEnterFrame function doesn't work. Why??

My First Class: Extends XML Feedback Welcome
Very basic but I am new to writing classes.
comments and suggestions for improvements and advances are always appreciated.

DMC_XML is an XML loader that automatically makes available the number of children within the XML file for you.

Ideal when using a loop to populate fields from xml files, as the number of children is readily available after the load.

NOTES:
There is also a static variable that tracks the number of xml instances that have been loaded.
I am thinking of expanding the class to chain together multiple XML loads.



USAGE:
simply define a new variable as an instance of DMC_XML
var info: DMC_XML = new DMC_XML ("map_info");

you can then reference the _xmlLength property to use in a loop that parses your xml.
var infoL:Number = info.get_xmlLength()
for(i=0; i<=infoL; i++){
code
}



Code:

class DMC_XML extends XML {
//
//***** private variables *****
//
private static var _xmlInstances:Number = 0;
private var _xmlFileName:String;
private var _xmlFile:XML;
private var _xmlLength:Number;
private var _interval:Number;
//
//***** constructor *****
//
public function DMC_XML (arg1:String) {
_xmlInstances++;
trace ("xml file loading = " + arg1);
this._xmlFileName = arg1;
this._xmlFile = new XML ();
this._xmlFile.ignoreWhite = true;
this._xmlFile.load ("xml/" + arg1 + ".xml");
this._interval = setInterval (this, "monitorLoad", 10);
this._xmlFile.onLoad = function (success) {
if (success) {
trace (arg1 + " xml file loaded");
}
};
}
//
//***** static methods *****
//
static function get_xmlInstances ():Number {
return _xmlInstances;
}
//
//***** getters & setters *****
//
public function get_xmlFileName ():String {
return this._xmlFileName;
}
public function set_xmlFileName (arg1:String):Void {
this._xmlFileName = arg1;
}
public function get_xmlFile ():XML {
return this._xmlFile;
}
public function set_xmlFile (arg1:XML):Void {
this._xmlFile = arg1;
}
public function get_xmlLength ():Number {
return this._xmlLength;
}
public function set_xmlLength (arg1:Number):Void {
this._xmlLength = arg1;
}
//
//***** methods *****
//
public function countChildren ():Void {
trace ("counting children in " + get_xmlFileName ());
var file:XML = get_xmlFile ();
var activeNode:XMLNode = file.firstChild.firstChild;
var nextNode:XMLNode = activeNode.nextSibling;
var lastNode:XMLNode = file.firstChild.lastChild;
var counter:Number = 0;
do {
counter++;
activeNode = nextNode;
nextNode = activeNode.nextSibling;
} while (nextNode.nodeName != null);
set_xmlLength (counter);
trace ("zero based number of children in " + get_xmlFileName () + " = " + counter);
}
//-----------------------------------------------------
//
private function monitorLoad () {
var bLoad:Number = _xmlFile.getBytesLoaded ();
var bTotal:Number = _xmlFile.getBytesTotal ();
//trace (bLoad);
//trace (bTotal);
if (bLoad > 0 && bLoad == bTotal) {
countChildren ();
//trace (_xmlFileName + " monitorLoad interval cleared");
clearInterval (this._interval);
}
}
//-----------------------------------------------------
//
}

Extends XML Build-in Class
The following is my code ...
I want the extends the XML class to my custom class(XMLReader),
But i find that i cannot get the firstChild after success load the XML .
Please help ~!
What's wrong for my coding ~!

function XMLReader() {
}
// Construct an XML object to hold the server's reply
XMLReader.prototype = new XML();
//ignore XML white space
XMLReader.prototype.ignoreWhite = true;
// this function triggers when an XML packet is received from the server.
XMLReader.prototype.load = function(success) {
if (success) {
trace("SUCCESS");
trace(this);
} else {
trace("FAILED");
}
};
XMLReader.prototype.getRoot = function() {
return super.firstChild;
};



XMLReader = new XMLReader();
XMLReader.load("http://localhost:8103/Category.xml");
trace(XMLReader.getRoot());

AS 2.0 Class:MCFader Extends MovieClip
Hi All,
I was just dabbling around and I came up with this class, I thought I would pass it on for all you AS 2.0 addicts. I'm still learning so Feedback is appreciated. Is there a way to implement this class on all MovieClips without setting the linkage for each MC symbol in the library?


Code:
/*
::AS 2.0 CLASS:: MCFader v0.0.2 by apolo@comcast.net
::Date Modified:: 11/21/03
::Purpose:: Fades a MovieClip
::Methods:: fade(startingAlpha, endingAlpha, [speed]);
::USAGE- fade in:: from 0% to 100% _alpha(at a speed of 10 frame per second) no matter what the begining _alpha of the MC is:: myMC.fade(0,100,10);}
::USAGE - fade in:: myMC.onMouseDown = function (){this.fade(this._alpha,100);}
::USAGE - fade out:: myMC.onMouseDown = function (){this.fade(this._alpha, 0);}
::USAGE - fade out slowly to 50% alpha:: myMC.onMouseDown = function (){this.fade(this._alpha, this._alpha/2, 1);}
*/

class MCFader extends MovieClip{

// Our Constuctor inherits the MovieClip's constructor
function MCFader(){
super();
}

// declare the method we will be using
private var onEnterFrame:Function;

public function fade(sAlpha:Number, eAlpha:Number, speed:Number):Void {

var once:Boolean = false; // init flag

onEnterFrame = function(){

// handle the fading
if(sAlpha < eAlpha){ // fade in
if(!once){
if(!speed){ // set Default speed value if needed
speed = 5;
}
_alpha = sAlpha;
once = true;
}
if(_alpha < eAlpha){
//trace(_alpha);
_alpha += speed;
}else{
delete onEnterFrame; // were finished now, so collect garbage
}
}else{
if(!once){
if(!speed){ // set Default speed value if needed
speed = 5;
}
_alpha = sAlpha;
once = true;
}
if(_alpha > eAlpha){ // or fade out
_alpha -= speed;
}else{
delete onEnterFrame; // were finished now, so collect garbage
}
}
}
}
}

Newbie note:
To use this class just save the below code as the file name MCFader.as, keep it in the same directory as your .fla
In your .fla, right click the symbol(s) in the library you want to be able to fade, choose linkage, click export the for actionscript radio button. type in a name for the idenifier, in the AS 2.0 Class field type in MCFader, click ok.

Enjoy,
~Dev

Class PrintView Extends MovieClip {
Hi...

I wrote a class that extends a movie clip which I have in the library of my .fla. The class has a constructor which calls a few functions to get the program flowing. I attach the movie clip in a different class. I dont know where to call the constructor for thhe attached clip (timeline, previous movie clip etc...) I attached the class...

I know this is new stuff to mx 2004. Thanks

[F8] Class Extends Sound - OnSoundComplete
Hi all,

I hesitated where to put this question, decided not to ask in Sound but over here.
I am experimenting with some sounds I like to behave independently.
I have several soundfiles in my library, Linkage name 1.wav 2.wav ... 12.wav

I defined a class:
code: class classes.sndz extends Sound
It has these lines:
code: public function sndz(sn:String)
{
trace("sndz init: ");
this.attachSound(sn);
this.start();
}

In my main class I put these lines:
code: for (var s=1; s<13; s++)
{
var sn = s.toString()+".wav"
var snd:sndz = new sndz(sn);
}

Now when I do a preview all these wavs sound together, so upto here I have a bit of the class I want. Now I want to use onSoundComplete to do some things when the sounds are ready playing. I tried two ways:
1st: in classes.sndz
code: public function onSoundComplete()
{
trace("SC");
}
2nd: in classes.sndz inside function sndz(sn:String
code: this.onSoundComplete = sndReady;

and elsewhere in this class

function sndReady()
{
trace("Ready");
}
I cannot get the onSoundComplete working.
Anybody any ideas? Thanks for answering.

Extends Class Target Problem
inside Get2lvXML.as

import mx.events.EventDispatcher;
class Get2lvXML extends XML {
private var dispatchEvent:Function;
public var addEventListener:Function;
public function Get2lvXML() {
EventDispatcher.initialize(this);
}
}


inside GetShop.as

class GetShop extends Get2lvXML {
public function GetShop(){
testing_fun();
}
private function testing_fun(){
dispatchEvent({type:"shopNoReady", target:this});
}
}



inside fla

var myShopNo:GetShop = new GetShop();
function myShopNoReady_fun() {
trace("myShopNoReady");

}
myShopNo.addEventListener("shopNoReady", myShopNoReady_fun);





I have tried a lot of possibilty of error, it seems the "target:this" got problem

Anyone can help me?

Thanks in advance

zerolam

AS3.0: How To Extend A Class That Extends MovieClip
When I try to set the base class of a library symbol to a class that doesn't DIRECTLY extend MovieClip, but instead extends another class that DOES extend MovieClip, it's disallowed, saying, "The class 'Whatever' must subclass 'flash.display.MovieClip' since it is linked..."

Is this just a validation bug in the property windows, only checking one class deep into the inheritance hierarchy? Because the specified class does extend MovieClip, just two levels in instead of one. Is there a fix for this? Or must library symbols always directly extend MovieClip? If so, why?

Class MovieClip Extends ..how To Initialize Different URL's?
Hello, I have made this class. And in my fla file i made a movieclip and linked this class to it.
When it's on the stage it automatically initialize the funtion that i made in the class.
But if i make copies of this movieclip i cannot change the url of the picture anymore.

Does anyone know how to do this?

You can download this example at: (fla + as class file)
http://www.webdesign-cs.com/vintages/classFoto.zip


I was thinking of something like this:
laadmij:laadFoto = new laadFoto("foto1.jpg");
laadmij2:laadFoto = new laadFoto("foto2.jpg");
laadmij3:laadFoto = new laadFoto("foto3.jpg");

But that does not work.











Attach Code

class laadFoto extends MovieClip {
function laadFoto() {
var laderFoto:MovieClipLoader = new MovieClipLoader();
var objectnaam:Object = new Object();
var breed:Number = this._width-20;
var hoog:Number = this._height-20;
objectnaam.onLoadInit = verschalen(breed, hoog);
laderFoto.addListener(objectnaam);
laderFoto.loadClip("test.jpg", this);
}
function verschalen(b, h) {
this._width = b;
this._height = h;
}
}

[Q] DropTarget With Class Extends MovieClip
Dear all,

The following is a Class called 'Ball', just a drag and drop movie clip
I would like to check that ...
if the Ball has been dropped on/over the OBJECT1.

But i don't know how to write it in a class
The OBJECT1 is already created on root and named as 'object1'



Code:

package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
private var holder:MovieClip = new MovieClip();
public class Ball extends MovieClip {
public function Ball() {
this.buttonMode = true;
this.addChild(holder);
this.addEventListener(MouseEvent.MOUSE_DOWN, onDragHandler);
this.addEventListener(MouseEvent.MOUSE_UP, onDropHandler);
}
}
function onDragHandler(e:MouseEvent):void {
this.startDrag();
}
function onDropHandler(e:MouseEvent):void {
this.stopDrag();
if (this.dropTarget == root.object1) {
trace("Hit");
}
}
}
tried :
if (this.dropTarget == root.object1) {
trace("hit");
}
result:
1119: Access of possibly undefined property OBJECT1 through a reference with static type flash.displayisplayObject.

tried:
if (this.dropTarget == MovieClip(root).object1) {
trace("hit");
}
result:
nothing happened

Referencing Buttons From Class That Extends Movieclip
I'm attaching actionscript classes to my movie clips by extending the MovieClip class and specifying the AS 2.0 class in the linkage properties in the library – with the intention of having basically no code in the FLA.

This works fine and I can respond to events and reference objects contained within that movie clip by declaring a variable with the same name as the object's instance name in the class.

PROBLEM is that the object has to be present on the first frame of the MC, or the class just doesn't know about its existence. I have a short animation on the timeline, and then the btnOK button appears for the first time a few frames later. Problem is that I can't setup any sort of event handler or listener, because when the class is initialised on the first frame it doesn't seem to know about the button.

So in the below code... if the btnOK is on the first frame of the timeline, it traces, otherwise btnOK is undefined.


Code:
class myMC extends MovieClip {

var btnOK:Button;

function myMC() {
btnOK.onPress = function() { trace("clicked") };
}
}
Yeah sure I could place the button on the first frame and show/hide it as needed but that wouldn't be ideal and would make me want to vomit.

By the way, I'm talking about normal everyday button symbols, not the Button component.

Any ideas?

Cheers.

Quick Class Extends MovieClip Question
Hi guys

I have one small question for u OOP dudes out there. I'm doing a simple frames per seconds class here:


ActionScript Code:
class FrameChecker extends MovieClip
{
    private var _nLastTime:Number;
   
    public function FrameChecker()
    {
        _nLastTime = getTimer();
    }
   
    public function onEnterFrame():Void
    {
     var num = Math.floor(1000/(getTimer()-_nLastTime));
       
        this.txt.text = "FPS = " + num; // don't work
        this.bar.width = num; // don't work
       
        trace(num); // works fine
     
        _nLastTime = getTimer()
    }
}

In my library I have a movieclip with a dynamic textField with instancename "txt" and a movieclip with the instancename "bar". I set linkage AS in frame 1, and added the FrameChecker class to it. I've dragged this movieclip on to my stage and imported my FrameChecker class (above) in frame one (don't know is this is necesary???). The framerate traces out fine, but for some reason the two things don't work!?

I'm pretty sure this is a simple matter, but never tried this before!?

Thnx

Class Extends MovieClip (how Do I Modify Events?)
I'm trying to modify the onPress and onRelease events for a movieclip linked to this class. It isn't working, so I must be doing something wrong. I marked the lines where I'm trying to modify these events. Any ideas?


ActionScript Code:
class PPSlide extends MovieClip {    var strSlideTitle:String;    var strSlideNumber:String;    var strFileName:String;        var txtSlideTitle:mx.controls.Label;    var txtSlideNumber:mx.controls.Label;    var txtFileName:mx.controls.Label;    var mcPreviewImage:MovieClip;        var origX:Number;    var origY:Number;    var highDepth:Number;        function PPSlide() {        this.strSlideTitle = strSlideTitle;        this.strSlideNumber = strSlideNumber;        this.strFileName = strFileName;                this.txtSlideTitle.text = this.strSlideTitle;        this.txtSlideNumber.text = "Slide " + this.strSlideNumber;        this.txtFileName.text = this.strFileName;        this.mcPreviewImage.loadMovie(this.strFileName);                function onPress() {  //won't work            this.startDrag();            origX = this._x;            origY = this._y;            highDepth = this.getNextHighestDepth();            this.swapDepths(highDepth);        }                function onRelease() {  //won't work            this.stopDrag();            this._x = origX;            this._y = origY;        }    }}


EDIT: I tryed this also (with no success):


ActionScript Code:
class PPSlide extends MovieClip {    var strSlideTitle:String;    var strSlideNumber:String;    var strFileName:String;        var txtSlideTitle:mx.controls.Label;    var txtSlideNumber:mx.controls.Label;    var txtFileName:mx.controls.Label;    var mcPreviewImage:MovieClip;        var origX:Number;    var origY:Number;    var highDepth:Number;        function PPSlide() {        this.strSlideTitle = strSlideTitle;        this.strSlideNumber = strSlideNumber;        this.strFileName = strFileName;                this.txtSlideTitle.text = this.strSlideTitle;        this.txtSlideNumber.text = "Slide " + this.strSlideNumber;        this.txtFileName.text = this.strFileName;        this.mcPreviewImage.loadMovie(this.strFileName);                onPress = doDrag();        onRelease = doDrop();    }        private function doDrag() {        this.startDrag();        origX = this._x;        origY = this._y;        highDepth = this.getNextHighestDepth();        this.swapDepths(highDepth);    }            private function doDrop() {        this.stopDrag();        this._x = origX;        this._y = origY;    }}

OOP: Custom Listener For A Class That Extends Point. (Help?)
I have a class that extends Point, so it cannot extend EventDispatcher. I also cannot get it to implement IEventDispatcher, which seems to make it angry.

Does anyone have a simplified version of the following pseudo?
class blah{
constructor( superCoolEvent arguement ){
addListener( superCoolEvent, doStuff );
}
private function doStuff(){...}
}

I saw this in Tip of the Day, but... well the vocabulary confused me senseless.
Anyway, thanks!

Class Extends MovieClip (how Do I Modify Events?)
I'm trying to modify the onPress and onRelease events for a movieclip linked to this class. It isn't working, so I must be doing something wrong. I marked the lines where I'm trying to modify these events. Any ideas?


ActionScript Code:
class PPSlide extends MovieClip {    var strSlideTitle:String;    var strSlideNumber:String;    var strFileName:String;        var txtSlideTitle:mx.controls.Label;    var txtSlideNumber:mx.controls.Label;    var txtFileName:mx.controls.Label;    var mcPreviewImage:MovieClip;        var origX:Number;    var origY:Number;    var highDepth:Number;        function PPSlide() {        this.strSlideTitle = strSlideTitle;        this.strSlideNumber = strSlideNumber;        this.strFileName = strFileName;                this.txtSlideTitle.text = this.strSlideTitle;        this.txtSlideNumber.text = "Slide " + this.strSlideNumber;        this.txtFileName.text = this.strFileName;        this.mcPreviewImage.loadMovie(this.strFileName);                function onPress() {  //won't work            this.startDrag();            origX = this._x;            origY = this._y;            highDepth = this.getNextHighestDepth();            this.swapDepths(highDepth);        }                function onRelease() {  //won't work            this.stopDrag();            this._x = origX;            this._y = origY;        }    }}


EDIT: I tryed this also (with no success):


ActionScript Code:
class PPSlide extends MovieClip {    var strSlideTitle:String;    var strSlideNumber:String;    var strFileName:String;        var txtSlideTitle:mx.controls.Label;    var txtSlideNumber:mx.controls.Label;    var txtFileName:mx.controls.Label;    var mcPreviewImage:MovieClip;        var origX:Number;    var origY:Number;    var highDepth:Number;        function PPSlide() {        this.strSlideTitle = strSlideTitle;        this.strSlideNumber = strSlideNumber;        this.strFileName = strFileName;                this.txtSlideTitle.text = this.strSlideTitle;        this.txtSlideNumber.text = "Slide " + this.strSlideNumber;        this.txtFileName.text = this.strFileName;        this.mcPreviewImage.loadMovie(this.strFileName);                onPress = doDrag();        onRelease = doDrop();    }        private function doDrag() {        this.startDrag();        origX = this._x;        origY = this._y;        highDepth = this.getNextHighestDepth();        this.swapDepths(highDepth);    }            private function doDrop() {        this.stopDrag();        this._x = origX;        this._y = origY;    }}

Public 'final' Class
Is there any performance improvement by declaring your classes as final? Or is that solely for the complier checking?

Using A Public Class Method
Hi guys

quick question really. I have a Scrollbar class with a public method, arrowPressed(e:MouseEvent), that i'm trying to call from another class, TimelineArea(), using objects with the same name with the lines:

Code:
left_arrow.addEventListener( MouseEvent.MOUSE_DOWN, scrollbar.arrowPressed );
right_arrow.addEventListener( MouseEvent.MOUSE_DOWN, scrollbar.arrowPressed );
note scrollbar is an instance of the Scrollbar class

the method in the Scrollbar class is as follows:

Code:
public function arrowPressed( e:MouseEvent ):void
{
var dir:int = (e.target == left_arrow) ? -1 : 1;
var total:Number = slider.percent + (dir * scrollSpeed);
Tweener.addTween(slider,{percent:total, time:0.5}); // Tweener tween added to add friction to arrow presses - God bless Zeh and chums!
}
The result of this is that both left_arrow and right_arrow in the TimelineArea class give a (e.target == left_arrow) = false result and only move the timeline forward whereas the left_arrow and right_arrow within the Scrollbar class give the correct result: right_arrow = false (moves the timeline +1), left_arrow = true (moves the timeline -1)

why would using the public method externally pass a different result to using it internally, please?

I've included both classes below for context

thanks for your time
a




Scrollbar Class

Code:
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import com.caurina.transitions.*;

public class Scrollbar extends Sprite
{
// elements
protected var slider:Slider;
protected var left_arrow:Sprite;
protected var right_arrow:Sprite;

protected var scrollSpeed:Number = .02;

// read/write percentage value relates directly to the slider
public function get percent():Number { return slider.percent; }
public function set percent( p:Number ):void { slider.percent = p; }

public function Scrollbar()
{
createElements();
}

// executes when the up arrow is pressed
public function arrowPressed( e:MouseEvent ):void
{
var dir:int = (e.target == left_arrow) ? -1 : 1;
var total:Number = slider.percent + (dir * scrollSpeed);
Tweener.addTween(slider,{percent:total, time:0.5}); // Tweener tween added to add friction to arrow presses - God bless Zeh and chums!
}

protected function createElements():void
{
slider = new Slider();

left_arrow = new Sprite();
left_arrow.graphics.beginFill( 0x999999, 1 );
left_arrow.graphics.moveTo(20,0);
left_arrow.graphics.lineTo(20,40);
left_arrow.graphics.lineTo(10,40);
left_arrow.graphics.curveTo(0,40,0,30);
left_arrow.graphics.lineTo(0,10);
left_arrow.graphics.curveTo(0,0,10,0);
left_arrow.graphics.lineTo(20,0);
left_arrow.graphics.endFill();

right_arrow = new Sprite();
right_arrow.graphics.beginFill( 0x999999, 1 );
right_arrow.graphics.lineTo(10,0);
right_arrow.graphics.curveTo(20,0,20,10);
right_arrow.graphics.lineTo(20,30);
right_arrow.graphics.curveTo(20,40,10,40);
right_arrow.graphics.lineTo(0,40);
right_arrow.graphics.lineTo(0,0);
right_arrow.graphics.endFill();

slider.x = left_arrow.width;
right_arrow.x = slider.x + slider.width;

left_arrow.addEventListener( MouseEvent.MOUSE_DOWN, arrowPressed );
right_arrow.addEventListener( MouseEvent.MOUSE_DOWN, arrowPressed );

addChild( slider );
addChild( left_arrow );
addChild( right_arrow );
}


public override function addEventListener( type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false ):void
{
if ( type === SliderEvent.CHANGE )
{
slider.addEventListener( SliderEvent.CHANGE, listener, useCapture, priority, useWeakReference );
return;
}
super.addEventListener( type, listener, useCapture, priority, useWeakReference );
}
public override function removeEventListener( type:String, listener:Function, useCapture:Boolean=false ):void
{
if ( type === SliderEvent.CHANGE )
{
slider.removeEventListener( SliderEvent.CHANGE, listener, useCapture );
return;
}
super.removeEventListener( type, listener, useCapture );
}
}
}
TimelineArea Class (cut down for readability and relevance)

Code:
package
{
//package imports
import flash.display.Sprite;

//scrollbar imports
import com.caurina.transitions.*;
import flash.geom.*;
import flash.events.*;
import com.receptacle.utils.*; // includes SimpleRectangle and SimpleTextField

internal class TimelineArea extends Sprite
{
// class variable declarations
private var cp:CommonProperties;
private var taTitleBarY;
private var taPanelY:uint;
private var taPanelHeight:uint
private var scrollableBase:Sprite;
private var scrollbar:Scrollbar
private var stage_width:uint;
private var stage_height:uint;
private var yearDistance:uint;
private var startYear:int;
private var endYear:int;
private var yearDiv:uint;
private var panelY:uint;
private var panelColour:uint;
private var taTitleBarHeight:uint;
private var nonScrollableBase:Sprite;
private var commonGrey:uint;
private var subheadingFont:String;
private var headingFont:String;

// constructor
public function TimelineArea():void
{
setVars();
initialiseTimelineScrollBar();
addTimelineAreaNavigation();
}

private function setVars()
{
scrollbar = new Scrollbar();
cp = new CommonProperties();
stage_width = cp.stage_width;
stage_height = cp.stage_height;
taTitleBarHeight = cp.taTitleBarHeight;
taTitleBarY = cp.taTitleBarY;
taPanelY = cp.taPanelY;
taPanelHeight = cp.taPanelHeight;
commonGrey = cp.tickColour;
headingFont = cp.headingFont;
subheadingFont = cp.subheadingFont;
yearDistance = cp.yearDistance;
startYear = cp.startYear;
endYear = cp.endYear;
yearDiv = cp.yearDiv;


scrollbar.x = 16;
scrollbar.y = 550-cp.titleBarHeight;
scrollableBase = new Sprite();
nonScrollableBase = new Sprite();
scrollableBase.y = 0;

addChild(scrollableBase);
addChild(nonScrollableBase);
}


private function initialiseTimelineScrollBar():void
{
trace ("Timeline scrollbar initialised");

var scroll_rect:Rectangle = new Rectangle( 0, 0, stage_width, taPanelHeight+taTitleBarHeight+30 );
var sc:ScrollContent = new ScrollContent( scrollableBase, scrollbar, scroll_rect );

addChild( scrollbar );
}


private function addTimelineAreaNavigation():void
{
var left_arrow:SimpleRectangle = new SimpleRectangle(0x000000, 0x000000, 0, 0, stage_width/3, taPanelHeight + taTitleBarHeight);
var right_arrow:SimpleRectangle = new SimpleRectangle(0x000000, 0x000000, (stage_width/3)*2, 0, stage_width/3, taPanelHeight + taTitleBarHeight);

left_arrow.alpha = 0;
right_arrow.alpha = 0;

left_arrow.addEventListener( MouseEvent.MOUSE_DOWN, scrollbar.arrowPressed );
right_arrow.addEventListener( MouseEvent.MOUSE_DOWN, scrollbar.arrowPressed );

addChild(left_arrow);
addChild(right_arrow);
}

}
}

Using A Public Function From Another Class
Seen several threads but nothing has stuck out to me as a solution. Basically, my sample set up uses 3 classes:

BuildPageClass - main class that pulls all data needed from XML and loads colors xml and stylesheet locations
BuildContentClass - builds the content
BuildFullPageWithImages - builder class

What I want to do is pull in a function from the BuildContentClass and use it to pass a variable pageContent_str:String within the BuildFullPageWithImages to build out the content from the other class. None of the classes are extended. I have imported the class as appropriate. I have tried the following sample scenario with receiving no results:


ActionScript Code:
/* BuildFullPageWithImages CLASS */
/* import class that I need to call function from inside it */
import BuildContentClass;

class BuildFullPageWithImages {
   
    /* declare variables */
    private var buildContent_app:BuildContentClass;
    private var pageContent_str:String;

    function BuildFullPageWithImages() {

         /* declare global variables for class */
         buildContent_app = new BuildContentClass();
         pageContent_str = "test";

         /* call function as needed  */
         buildOutApplication();
    }
   
    private function buildOutApplication():Void {

       /* function that I am trying to use but returns nothing */
       buildContent_app.callSomeFunction(pageContent_str);
    }
}

/* BuildContentClass CLASS */

class BuildContentClass {
    /* declare variable */
    private var pageContent_str:String;

    function BuildContentClass() {

         /* declare global variables for class */
         pageContent_str = new String();

         /* call function as needed  */
         someFunction();
    }

    private function someFunction():Void {
    }

    /* function I am trying to pull */
    public function callSomeFunction(pageContent_str:String):Void {

      trace(pageContent_str);
    }
}

Any suggestions to what I am doing incorrectly? Scope maybe? I am still struggling to understand that part of classes. Again as always, thanks for you help!

How Do I Dynamically Create An Instance Of Class Which Extends MovieClass
I have a class which extends the MovieClip Class. I know I can create a symbol in the library, create an instance of it, give a name and manually set AS linkage to my extended class - is there a way to do it without creating a symbol at all. I.e. create an empty movie clip and then just cast it to my class that extends Movie clips?
Thanks
Leonid

How To Create A Class Which Extends MovieClip Inside A Function
Hi,

I am new to ActionScript. i am trying to write an example which extends a MovieClip class. Here is the code, but I can't get it to compile.

Can you please help me?

class Tuto {

static var app : Tuto;

function Tuto() {

trace( "start !");



trace( "end !");

}

// entry point
static function main(mc) {
app = new Tuto();

myMovie extends MovieClip;
var v2 = v1.prototype;


v2.setMovie = function (_video_id, image_url, movie_url, l,
_track_id, eurl, append_vars) {
trace( "setMovie !");
}
}
}

Thank you.

AS2: How Do I Pass Constructor Arguments Into An Instance That Extends The MC Class?
For example, I have the class Bullet, with a constructor:

Bullet(start:Point, target:Point){...} // constructor

But, if this Bullet class extends the MovieClip class, how do I pass start and target into it? Right now I am using attachMovie to create instances of the class. (They behave correctly with the static properties set by the constructor, but to be useful it needs arguments.)

Syntax Error In Class Declaration Extends MovieClip
So, I'm trying to get used to OOP flash and I'm getting kicked even before I start.

I have the beginning of the class which is implemented as such

Code:
class AuthorizeClass extends Movieclip
{

}
I have saved this in AuthorizeClass.as and include the class in test.swf like this:

#include "AuthorizeClass.as"


and I get this error:

AuthorizeClass.as: Line 1: Syntax error.
class AuthorizeClass extends Movieclip

What gives?

How Do I Dynamically Create An Instance Of Class Which Extends MovieClass
I have a class which extends the MovieClip Class. I know I can create a symbol in the library, create an instance of it, give a name and manually set AS linkage to my extended class - is there a way to do it without creating a symbol at all. I.e. create an empty movie clip and then just cast it to my class that extends Movie clips?

Thanks Leonid

Syntax Error In Class Declaration Extends MovieClip
So, I'm trying to get used to OOP flash and I'm getting kicked even before I start.

I have the beginning of the class which is implemented as such
CODEclass AuthorizeClass extends Movieclip
{
    
}

Not Public, Not Private...class Identifier
if it is not public, and not private, what is it? I have a class that works only if i do not declare a function public or private...is there a name to identify this function? let me know if you need the code, but i think this can be answered without....

Public Properties In Class File
Hi all,

I am sorry if this has been posted already, i am in a little bit of a rush and couldn't find the answers to my question.

I am new with the actionscript language, though have noticed it isn't a million miles away from the C# i write day in day out.

I am writing a class file that will eventually read and parse an XML file, however i seem to be having problems with the properties - perhaps the scope, thogh even _global doesn help.

I have posted a bit of the code below - again this is a work in progress and commented the areas of problem.

Basically i am trying to populate some properties that will be read from the calling script.

The property causing problems is ClientDetail. It populates before the While loop - though not at all in this loop or after it.




Code:
class ClientData {

private var _XMLPath = "flashsource.xml";

// private vars
private var _clientname:String;
private var _clientdetail:String;

// public properties
public function get ClientName():String
{
return this._clientname;
}

public function get ClientDetail():String
{
return this._clientdetail;
}


// constructor
public function ClientData(ClientName:String)
{
_clientname = ClientName;
//this._clientdetail = "oooooo nice!";
// if i uncomment this the property is populated
var xml:XML = new XML();
xml.load(_XMLPath);
xml.onLoad = function(success:Boolean){

if(success){

var node = xml.firstChild;

while (node != null) {

if (node.attributes["name"] == _clientname.toLowerCase())
{
trace("found subaru");
this._clientdetail = "oooooo nice!";
// Property NOT populated
}
else
{
//trace("not found....");
trace("clientname = " + _clientname.toLowerCase() + "");
}



trace("---------------------------");
for (var str in node.attributes) {
trace(node.nodeName+".attributes."+str+" = "+node.attributes[str]);
}
trace("---------------------------");
var node2 = node.firstChild;
while (node2 != null) {
for (var str2 in node2.attributes) {
trace(node2.nodeName+"."+str2+" = "+node2.attributes);
}
var val = node2.firstChild;
while (val != null) {
trace(node2.nodeName+" = "+val.nodeValue);
val = val.nextSibling;
}

node2 = node2.nextSibling;
}
node = node.nextSibling;
}

}
else
{
trace("error loading XML");
}

//this._clientdetail = "oooooo nice!";
// Uncommenting this also does not populate the property


}

}

}


Any help you can provide will be welcome.

Thanks in advance

Darren

Public Class That Can Work On All FP Versions
if any one can help how to make a public class that can work on all FlashPlayer Versions.
i want to load this class in to swf file on level1.

Using A Public Method From An Imported Class
Hi y'all!

I'm going to try my best at explaining my problem. I'm doing a project that has a jukebox in it that interacts with a list of artists, they are both MovieClips that contain TextFields and Buttons that are controlled by two separate classes: JukeBox.as, Artists.as(for a list) and Artist.as(for each individual artist. I want to access a method from an instance of JukeBox from the Artists (list), so every time I press the name of the artist it sends the id of it to the XML and picks out the mp3 and the info for this artist. Now I'm trying to do this this way. Instances of each class are called from the Main MovieClip:


Code:
/* in Artists.as find instance of JukeBox in Main and put the artists id in the instance */
parent.getChildByName('newJukeBox').findArtist(artist_id);
Yet I get this error:


Code:
1061: Call to a possibly undefined method findArtist through a reference with static type flash.display:DisplayObject.
THe method is defined in JukeBox class and it is public I don't see why it is not working, is there any way around this??? Thanks for all the help you can bring!

[F8] Different Between Private & Public Method In Custom Class
Hi...there..

Okay just a quick shoot here..okay let's say I have this sample class


Code:
class TestPrivate{

public function TestPrivate(){};

private function getGo(){
trace("can execute");
}

}



and then after instantiate I just calling the method...for testing the "public" and "private" keyword purposing only...


Code:
import TestPrivate;

var obj1 = new TestPrivate();
obj1.getGo();



the result is still can be execute eventhough I put the private keyword in front of the methods...

so what's the private keyword stands for actually...I thought it prevent been get accessed from outside ...hope someone will ******** to me...tq again...

Accessing Public Vars From Another Custom Class
Alright, I'm kind of new to AS and I'm working on a game. So far I have a Main class that has a few variables and the onEnterFrame function, and a class for my Level that's going to set a few things up when it's created.

I'm trying to get the Level class to change the variables in the Main class with "main.varName = 1" but I keep getting "1120, access of undefined property main." ("main" being what I called the child.)

So simply put, how do I access a variable in one child (or the main time line) with another child? I've searched all over with google and even tried the search thing here but couldn't find anything. Thx for any help.

Different Between Private & Public Method In Custom Class
Hi...there..

Okay just a quick shoot here..okay let's say I have this sample class


Code:
class TestPrivate{

public function TestPrivate(){};

private function getGo(){
trace("can execute");
}

}
and then after instantiate I just calling the method...for testing the "public" and "private" keyword purposing only...


Code:
import TestPrivate;

var obj1 = new TestPrivate();
obj1.getGo();
the result is still can be execute eventhough I put the private keyword in front of the methods...

so what's the private keyword stands for actually...I thought it prevent been get accessed from outside ...hope someone will clearify to me...tq again...

Help With Class Properties And Public/private Functions
I'm starting to really get the class thing-- and how nice it is to be so neat and organized with code! One of the (many) things still not clicking is accessing other classes properties. I think a lot of my errors come from functions not being declared as Public functions, but it seems that most of the times that I add Public, I get errors saying that function can't be part of that package. SO, to throw out a specific question for you all that will help me see the bigger picture, I have an Initital class that calls several instances of 2 other classes. Each of those classes also instantiate other classes. How do I access the properties of one class to another?

Main.fla--'Initial' class -- 'Btn' class-- 'Text' class-- 'Bkgd' class -- 'ThumbContainer' class -- 'Thumb' classHow do I access the 'Text' class(or property...) from the 'Thumb' class? I've tried, Btn.Text, Initial.Btn.Text, etc. but I keep getting an error that the property is undefined.

Different Between Private & Public Method In Custom Class
Hi...there..

Okay just a quick shoot here..okay let's say I have this sample class


Code:
class TestPrivate{

public function TestPrivate(){};

private function getGo(){
trace("can execute");
}

}
and then after instantiate I just calling the method...for testing the "public" and "private" keyword purposing only...


Code:
import TestPrivate;

var obj1 = new TestPrivate();
obj1.getGo();
the result is still can be execute eventhough I put the private keyword in front of the methods...

so what's the private keyword stands for actually...I thought it prevent been get accessed from outside ...hope someone will clearify to me...tq again...

Class Vs. Instance: Accessing Public Methods
I have a Segment class and instances of the segment class. Public functions called from the class itself fail, where functions called from instances work. Example:


Code:

import Scripts.Segment; // my class
import flash.geom.Point;

var p1:Point = new Point(1, 3);
var p2:Point = new Point(7, 4);
var p3:Point = new Point(4, 5);
var p4:Point = new Point(5, 1);

var mySegment1:Segment = new Segment(p1, p2); // generate two instances
var mySegment2:Segment = new Segment(p3, p4);

var p5:Point = mySegment1.intercept(mySegment1, mySegment2); // works
var p6:Point = Segment.intercept(mySegment1, mySegment2); // gives me an error
Error looks like this, by the way:
1061: Call to a possibly undefined method intercept through a reference with static type Class.

How do I access the methods without using an instance? Like the way one might use Point.distance(p1, p2)?

OOP: Private Array Property Still Public?
In my project I've defined a Point class to build Point objects.
I also built a Polygon class with a (private) array property, Points. The polygon class contains a method getPoints() which return the current Points array.

My objective is to built one or more Polygon objects and assign several Point objects to the Polygon's Points array.

Let's say I've created two Polygon objects, plgPolygon01 and plgPolygon02. To both objects I insert three new Point objects into the Points array.

As I call the plgPolygon01.getPoints() method, i expect to get an array with three values. But when I do this, I get an array with six values.

So I conclude: while I was inserting Point objects into the Points array of a Polygon object, this Points array seems to be public instead of private. Otherwise, I'd only get the Points I assigned to the first Polygon object and not all the Points assigned to polygons.

Erhm, help anyone?
Would this be a strange bug in ActionScript 2.0 of have I made a stupid error in design/assignment?

Copyright © 2005-08 www.BigResource.com, All rights reserved