BioBob Posted June 4, 2009 Share Posted June 4, 2009 Yeah, wrong forum. Sue me. The var called "img" loads from a PHP page so I guess it might qualify as a PHP question! lol var foo = "cheese"; if (vars_sent != 1) { var loader:MovieClipLoader = new MovieClipLoader(); loader.loadClip(img,ph); var pl:Object = new Object(); loader.addListener(pl); pl.onLoadInit = function(target) { cheese = "burgerTacoWax"; //gross, just like McDonalds } trace(cheese); vars_sent = 1; } How do I change the variable cheese to the new value outside the function pl.onLoadInit? I know its a scope problem, but AS is not the same as PHP and _global.var_name doesnt work. Googling hasnt helped either. Can anyone explain? Quote Link to comment https://forums.phpfreaks.com/topic/160941-need-actionscript-20-help-with-variable-scope/ Share on other sites More sharing options...
gevans Posted June 4, 2009 Share Posted June 4, 2009 Yeah, wrong forum. Sue me. The var called "img" loads from a PHP page so I guess it might qualify as a PHP question! lol Suprise suprise, I have no idea.... I had to post pointlessly here, but isn't that kind of what you've done anyway? Try an actionscript forum? Quote Link to comment https://forums.phpfreaks.com/topic/160941-need-actionscript-20-help-with-variable-scope/#findComment-849358 Share on other sites More sharing options...
BioBob Posted June 4, 2009 Author Share Posted June 4, 2009 I didnt feel like going thru the hassle of finding some site with a forum with a bunch of active users at 3AM and signing up, registering, waiting for admin approval if required, etc, etc, etc... As far as I understand this is a relatively easy actionscript question for those with experience in that screwball language... Was just hoping somebody with AS experience might point this out... Quote Link to comment https://forums.phpfreaks.com/topic/160941-need-actionscript-20-help-with-variable-scope/#findComment-849368 Share on other sites More sharing options...
BioBob Posted June 4, 2009 Author Share Posted June 4, 2009 Oh fun. Now no one will probably even look at this thread... Ah well... Quote Link to comment https://forums.phpfreaks.com/topic/160941-need-actionscript-20-help-with-variable-scope/#findComment-849591 Share on other sites More sharing options...
gevans Posted June 9, 2009 Share Posted June 9, 2009 As I said, try and action script forum. I'm not saying that no one here can help, but it's not exactly what the forum is directed at. Which is why you find yourself in the 'other' forum Quote Link to comment https://forums.phpfreaks.com/topic/160941-need-actionscript-20-help-with-variable-scope/#findComment-852530 Share on other sites More sharing options...
.josh Posted June 13, 2009 Share Posted June 13, 2009 perhaps it would help you out if I said variable scope in AS works more or less like directory paths. You can reference a variable by its relative or absolute path/to/variable but with the scene/stage/object/etc... Quote Link to comment https://forums.phpfreaks.com/topic/160941-need-actionscript-20-help-with-variable-scope/#findComment-855211 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.