This content has been marked as final. Show 8 replies
I can't give a definitive answer since I don't know what those while loops are testing, but while loops can often be the cause of things going on forever and ever... leading to errors such as you quoted.
an example of a php file that delineates the categories and images (written to by an admin section in Flash):
ok, also, i see now that the problem is in my cache... when it hangs after i load it the second time, once i clear my cache it doesn't hang.
i've never had any success with preventing Flash from caching - is there a particularly effective script or tag that will do so?
neither of the statements you have within the the while() loop are 'conditions' and evaluate to 'nothing' - this script will be very problematic and it would be far better to use a FOR loop here.
while (_root['cat_'+k]) <-- means nothing there is no condition declared
while (_root['cat_'+k] != undefined) <-- at least means something
whatever is within the condition of the loop should evaluate to a Boolean return - eg. true/false - either 'continuing' the looping action or finding that the condition has been 'satisfied' and the loop terminates.
additionally a nested while loop is going to be 'dangerous' unless you really , really know what you doing and have an absolutely controlled variable set that will 'always' without fail complete.
further - it's not a good idea to name MCs the same and nest them as in: ( gallery.gallery ) this will cause problems for the compiler - I'd change one of the two of these instance names.
actually, in as2 (_root['cat_'+k]) evaluates to true if the object exists and false if it doesn't exist.
and append a changing variable to your php-file call to prevent caching.
so you're saying that after &cat_0=FLOWERS& (or whatever) the while loop 'should' terminate ok...?
thanks kg... lol! :) good to know - but still he's looping through the vars right and not the instances physically on the stage so the var obj will always exist even if the mc obj doesn't right - seems a 'sketchy' method to me - also the jpg names begin with a number - doesn't Flash reject that as well?
well, the numbers don't cause a problem - the scripts run great the first time. and i've had some success appending ?1 to the end of "src = main.swf?1" in the html page - this seems to help, but i wouldn't know how to randomize an appendage like that, either in php in the page code or in the AS in the flash file (where it calls xxxxx_gallery.php).
I can't open my Flash right now to look at the code more because i'm reinstalling FW (something broke last night and FW is giving me a BSOD in Vista!!!)...