Seems like you could just pass in an Array of strings to check against. Something like the following

public function isImageLocationKnown(location:String, knownLocations:Array):Boolean
{
   var ret:Boolean = false;

   for each(var knownLocation:String in knownLocations)
   {
      if(location == knownLocation)
      {
         ret = true;
         break;
      }
   }

   return ret;
}

Then call this method passing your image.location and your array of things that you want to check against (which you can now build dynamically).

hth
Scott

mariovandeneynde wrote:
ok,
I just have to able to make a dynamic condition to give to my if-else
statement.

something like

if((MyImage.location.toString == "Here") or (MyImage.location.toString
== "there") or (MyImage.location.toString == "everywhere") etc. etc.)

so I don't know how long the string is going to be... therefor, I was
wondering if i could build a dynamic string and then pass this to my
ifelse statement.

--- In [email protected], "Michael Schmalle"
<[EMAIL PROTECTED]> wrote:
Like an interpreter?

Why do you want to do what you showed below?

Mike

On Mon, Jun 16, 2008 at 6:08 AM, mariovandeneynde <
[EMAIL PROTECTED]> wrote:

  No, I'm just wondering if there is a way to convert a string to
actual
actionscriptcode...

--- In [email protected] <flexcoders%40yahoogroups.com>,
"Michael
Schmalle"

<teoti.graphix@> wrote:
Hi,

There is no eval() in actionscript if that is what you are
wondering.
Mike

On Mon, Jun 16, 2008 at 5:33 AM, mariovandeneynde <
mariovandeneynde@> wrote:

Greetings,

I was wondering if the following situation would be possible:

imagine having a string like

var query:String = "Object.property.toString() ==
somevalue.toString()";
and that the string somehow could be converted to actual
actionscript
code...

if(query){
trace("your actionscriptquery worked");
}
else{
trace("your actionscriptquery did not worked");
}




--
Teoti Graphix, LLC
http://www.teotigraphix.com

Teoti Graphix Blog
http://www.blog.teotigraphix.com

You can find more by solving the problem then by 'asking the
question'.

--
Teoti Graphix, LLC
http://www.teotigraphix.com

Teoti Graphix Blog
http://www.blog.teotigraphix.com

You can find more by solving the problem then by 'asking the question'.





--
Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com
http://blog.fastlanesw.com

Reply via email to