=====================
var object:Object = {};
object[ 158 ] = "String";
=====================
How do I use the "String" to get 158...........thank you help me
=====================
var object:Object = {};
object[ 158 ] = "String";
=====================
How do I use the "String" to get 158...........thank you help me
At 5/3/12 06:42 AM, america190 wrote: =====================
var object:Object = {};
object[ 158 ] = "String";
=====================
How do I use the "String" to get 158...........thank you help me
It's possible but not easy to do. If "String" is your key in your hash, use it as a key:
object["String"] = 158;
If you have to insist on using 158 as key and "String" as value, please elaborate more on what you want to do.
At 5/3/12 06:57 AM, milchreis wrote:At 5/3/12 06:42 AM, america190 wrote: =====================It's possible but not easy to do. If "String" is your key in your hash, use it as a key:
var object:Object = {};
object[ 158 ] = "String";
=====================
How do I use the "String" to get 158...........thank you help me
object["String"] = 158;
If you have to insist on using 158 as key and "String" as value, please elaborate more on what you want to do.
============================================================
=========================
thank you very much!
this is my writ code
var object:Object = {};
object[ 0 ] = "goto1";
object[ 1 ] = "goto2";
object[ 2 ] = "goto3";
object[ 3 ] = "goto4";
when I know this value, i want get the value corresponding to the position.
At 5/3/12 07:07 AM, america190 wrote: this is my writ code
var object:Object = {};
object[ 0 ] = "goto1";
object[ 1 ] = "goto2";
object[ 2 ] = "goto3";
object[ 3 ] = "goto4";
when I know this value, i want get the value corresponding to the position.
Why do you use Object and not Array?
It's still not enough information, what do you want to achieve in the end?
You could substring the last character of the String, but your code looks like you're doing something very wrong.
when I know this value, i want get the value corresponding to the position.Why do you use Object and not Array?
It's still not enough information, what do you want to achieve in the end?
You could substring the last character of the String, but your code looks like you're doing something very wrong.
ouï¼OE i understand... use for ( var b* in Object )..
===code
public function getRaidMapId( raidId:int ):int
{
for ( var pi:* in _raidMap )
{
for each( var pj:RaidVO in _raidMap[pi] )
{
if ( pj.id == raidId )
return pi;
}
}
return 0;
}