Hi
I did something like this before... You can do a recursive method parsing
the path like this:
function extractObject(aPath:String):Object {
return extractObjectRecurs(this, aPath.split("."), 0);
} // end extractRunTime
function
extractObjectRecurs(aRankObject:Object,aPathArray:Array,aIndex:Number):Object
{
if (aIndex<aPathArray.length-1) {
return
extractObjectRecurs(aRankObject[aPathArray[aIndex]],aPathArray,aIndex+1);
} else {
return aRankObject[aPathArray[aIndex]];
}
} // end extractRecursRunTime
onEnterFrame = function() {
trace("--------------------------- NEW FRAME --------------------");
var path:String = Selection.getFocus();
trace("PATH: "+path);
var object:Object = extractObject(path);
trace("TARGET POSITION: "+object._x);
}
Put your object inside your object inside your object inside ... and on the
stage... run the fla and select it.
David Buff
----- Original Message -----
From: "Lieven Cardoen" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Sent: Thursday, October 19, 2006 4:53 PM
Subject: [Flashcoders] Selection.getFocus()
FlashCoders,
Selection.getFocus() gives back a String. Is there a way to get the
Object?
Thx, Lieven Cardoen
Lieven Cardoen
Application developer
indiegroup
interactive digital experience
engelse wandeling 2 k18
b8500 kortrijk
Indie group zal op maandag 23 oktober uitzonderlijk gesloten zijn.
Indie group will be closed on Monday, October 23th.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com