If Record is a class you created, then you are missing the "new" operator.

var temprec:Record = new Record(this.PointContainer.attachMovie ("Record", "Record_" + String(count++), this.getNextHighestDepth()));

Nathan
http://www.nathanderksen.com


On Jan 28, 2006, at 11:30 AM, Mark Ribau wrote:

Ok.  Someone please help.

I use the new point function listed below twice in the test code below that. Whichever 'point' is created last is the only one displayed, while the others are lost. How do I get it to keep the old attached movies too??

bleh.NewPoint function:

   function NewPoint():Record
   {
var temprec:Record = Record(this.PointContainer.attachMovie ("Record", "Record_" + String(count++), this.getNextHighestDepth()));
             return temprec;
   }

test code in frame 1:

trace(bleh.ImageContainer._width + " . " + bleh.PointContainer._x);
trace(bleh.ImageContainer._height + " . " + bleh.PointContainer._y);

var temprec:Record = bleh.NewPoint();
//parse line removed
temprec.gotoAndPlay("Normal");
temprec._x = temprec._GPSX * (bleh.ImageContainer._width / 2);
temprec._y = temprec._GPSY * (bleh.ImageContainer._height / 2);

var temprec2:Record = bleh.NewPoint();
//parse line removed
temprec2._x = temprec2._GPSX * (bleh.ImageContainer._width / 2);
temprec2._y = temprec2._GPSY * (bleh.ImageContainer._height / 2);
temprec2.gotoAndPlay("Normal");

trace(temprec._name);
trace(temprec._GPSX + ", " + temprec._GPSY);
trace(temprec._x + " , " + temprec._y)
trace(temprec._width + " x " + temprec._height)

trace(temprec2._name);
trace(temprec2._GPSX + ", " + temprec2._GPSY);
trace(temprec2._x + " , " + temprec2._y)
trace(temprec2._width + " x " + temprec2._height)

trace output:
undefined
undefined, undefined
undefined , undefined
undefined x undefined
Record_1
0.3000, 0.30000
45 , 45
10.5 x 10.5


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to