hi.

i had a similar problem casting a string to a boolean last week but
someone showed me the correct way to do it. unfortunately, it's not
working in my latest exercise. when i trace out the value i always get
"false" even when i change it to "true". what happened to my
conditional? ( i'm publishing to fp7 )

loadVariablesNum( "text.txt", 2 );

function checkParamsLoaded()
{
    if ( _level2 == undefined )
    {
        trace( "not yet." );
    }
    else
    {
        trace( "finished loading. killing interval." );
        trace( "-------------" );

        for ( i in _level2 )
        {
            trace( i + ": " + _level2[i] );
        }

        var temp:Boolean = ( _level2.textloaded == "true" ); //
'textloaded' is the var specified in the text file
        trace( "temp: " + temp ); // PROBLEM -- always outputs to
'false', even when var is set to 'true'
        trace( "typeof(temp): " + typeof(temp) ); // outputs to
"Boolean" = GOOD.
        trace("-------------");
        clearInterval( param_interval );
    }
}
var param_interval = setInterval(checkParamsLoaded, 100);

i know that loadVariablesNum changed its behavior in fp7 but i'm not
sure if that has anything to do with it. does anyone spot anything
wrong in there?

thanks for any tips. -- matt.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to