Re: Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
On 8/24/06, Chris Allen <[EMAIL PROTECTED]> wrote: Thanks for your help on this Ian. I'm not sure I understand all of what you found here, so let me summarize with some questions to see if I got it right. Flash 6 SWFs fail every time when loaded remotely? - This hasn't been my experience. I've been able to load some small ones (20K) without the issue. Yes, for me, they failed every time. You think it may have to so with domain security in Flash? It was one immediate thought. My main thought is about the seperation of the global spaces i.e. a Flash 6 clip loaded into a Flash 7+ clip doesn't share the same _global. I'd imagine the same is true with clips that have failed a domain security check. When loading from your files system the Flash 7 and 8 files load correctly but not Flash 6? Yes. Some findings I have made: The behavior is slightly different on a Macintosh versus a Windows machine. Which are you using? Windows XP. Slightly different in what way? Altering nothing before the SWF is fully loaded screws up the instanceof stuff but all of the MovieClip properties work just fine. If I try to alter the _visible property before it's fully loaded it causes that property to no longer function once fully loaded. That's even more peculiar. :-) Ian ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Again, how peculiar. I'd love to take a look at the internals of MovieClip and Flash's loader system to see what's causing that particular glitch! Cheers, Ian On 8/24/06, Chris Allen <[EMAIL PROTECTED]> wrote: Okay, I have fixed the problem. I would say that this is certainly bug with Flash, but there is a work around. Thanks to Keith Peters for mentioning this to me last night. So here's the deal... Back in the day before MovieClipLoader when you wanted to load and external SWF, you had to check a property of the MovieClip to see if it existed before you could manipulate it. You needed to create an interval that would check to see if it's initialized in this way. This all makes sense to me, but what doesn't, is that you can't just check that any property of MovieClip was set. There is a magic property that seems to indicate that the MovieClip is fully initialized. That property is _width. So with this in mind I added a check to the onLoadProgress event like so: private function handleLoadProgress(targetMC:MovieClip, loadedBytes:Number, totalBytes:Number):Void { if (MovieAsset.HIDE_WHEN_LOADED) { if (targetMC._width != undefined || targetMC._width != 0) { targetMC._visible = false; } } } Now, how's that for obscure? It does fix the issue, and instanceof is indeed a MovieClip once again. Oh, and even better, _visible works like a charm. Thanks again to all those that helped out with this one. -Chris ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Wow, and I thought KP was only good with random()! yeah yeah, I know, I owe you a beer for that one. On 8/24/06, Johannes Nel <[EMAIL PROTECTED]> wrote: ha, how old school. when in doubt wait a frame or 15... On 8/24/06, Chris Allen <[EMAIL PROTECTED]> wrote: > > Okay, > > I have fixed the problem. I would say that this is certainly bug with > Flash, but there is a work around. Thanks to Keith Peters for > mentioning this to me last night. > > So here's the deal... Back in the day before MovieClipLoader when you > wanted to load and external SWF, you had to check a property of the > MovieClip to see if it existed before you could manipulate it. You > needed to create an interval that would check to see if it's > initialized in this way. This all makes sense to me, but what doesn't, > is that you can't just check that any property of MovieClip was set. > There is a magic property that seems to indicate that the MovieClip is > fully initialized. That property is _width. > > So with this in mind I added a check to the onLoadProgress event like so: > > private function handleLoadProgress(targetMC:MovieClip, > loadedBytes:Number, totalBytes:Number):Void > { > if (MovieAsset.HIDE_WHEN_LOADED) > { > if (targetMC._width != undefined || > targetMC._width != 0) > { > targetMC._visible = false; > } > } > } > > Now, how's that for obscure? It does fix the issue, and instanceof is > indeed a MovieClip once again. Oh, and even better, _visible works > like a charm. > > Thanks again to all those that helped out with this one. > > -Chris > > On 8/24/06, Chris Allen <[EMAIL PROTECTED]> wrote: > > Thanks for your help on this Ian. > > > > I'm not sure I understand all of what you found here, so let me > > summarize with some questions to see if I got it right. > > > > Flash 6 SWFs fail every time when loaded remotely? - This hasn't been > > my experience. I've been able to load some small ones (20K) without > > the issue. > > > > You think it may have to so with domain security in Flash? > > > > When loading from your files system the Flash 7 and 8 files load > > correctly but not Flash 6? > > > > Some findings I have made: > > > > The behavior is slightly different on a Macintosh versus a Windows > > machine. Which are you using? > > > > Altering nothing before the SWF is fully loaded screws up the > > instanceof stuff but all of the MovieClip properties work just fine. > > > > If I try to alter the _visible property before it's fully loaded it > > causes that property to no longer function once fully loaded. > > > > > > I have some other ideas to try out this morning and I will keep you > > posted on my progress. Thanks to all of you who tried to help. > > > > -Chris > > > > > > On 8/24/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > > > Oh, I should add - I get the same results when I throw the Fling code > > > out completely and write a simple loader from scratch. > > > > > > Cheers, > > > Ian > > > > > > On 8/24/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > > > > > > > I'm certainly running out of ideas for a simple fix, here - and it's > > > > definitely not the loading code, it's a 'feature' or bug in the > Flash > > > > Player. > > > ___ > > > Flashcoders@chattyfig.figleaf.com > > > To change your subscription options or search the archive: > > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > Brought to you by Fig Leaf Software > > > Premier Authorized Adobe Consulting and Training > > > http://www.figleaf.com > > > http://training.figleaf.com > > > > > > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- [ JPG ] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
ha, how old school. when in doubt wait a frame or 15... On 8/24/06, Chris Allen <[EMAIL PROTECTED]> wrote: Okay, I have fixed the problem. I would say that this is certainly bug with Flash, but there is a work around. Thanks to Keith Peters for mentioning this to me last night. So here's the deal... Back in the day before MovieClipLoader when you wanted to load and external SWF, you had to check a property of the MovieClip to see if it existed before you could manipulate it. You needed to create an interval that would check to see if it's initialized in this way. This all makes sense to me, but what doesn't, is that you can't just check that any property of MovieClip was set. There is a magic property that seems to indicate that the MovieClip is fully initialized. That property is _width. So with this in mind I added a check to the onLoadProgress event like so: private function handleLoadProgress(targetMC:MovieClip, loadedBytes:Number, totalBytes:Number):Void { if (MovieAsset.HIDE_WHEN_LOADED) { if (targetMC._width != undefined || targetMC._width != 0) { targetMC._visible = false; } } } Now, how's that for obscure? It does fix the issue, and instanceof is indeed a MovieClip once again. Oh, and even better, _visible works like a charm. Thanks again to all those that helped out with this one. -Chris On 8/24/06, Chris Allen <[EMAIL PROTECTED]> wrote: > Thanks for your help on this Ian. > > I'm not sure I understand all of what you found here, so let me > summarize with some questions to see if I got it right. > > Flash 6 SWFs fail every time when loaded remotely? - This hasn't been > my experience. I've been able to load some small ones (20K) without > the issue. > > You think it may have to so with domain security in Flash? > > When loading from your files system the Flash 7 and 8 files load > correctly but not Flash 6? > > Some findings I have made: > > The behavior is slightly different on a Macintosh versus a Windows > machine. Which are you using? > > Altering nothing before the SWF is fully loaded screws up the > instanceof stuff but all of the MovieClip properties work just fine. > > If I try to alter the _visible property before it's fully loaded it > causes that property to no longer function once fully loaded. > > > I have some other ideas to try out this morning and I will keep you > posted on my progress. Thanks to all of you who tried to help. > > -Chris > > > On 8/24/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > > Oh, I should add - I get the same results when I throw the Fling code > > out completely and write a simple loader from scratch. > > > > Cheers, > > Ian > > > > On 8/24/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > > > > > I'm certainly running out of ideas for a simple fix, here - and it's > > > definitely not the loading code, it's a 'feature' or bug in the Flash > > > Player. > > ___ > > Flashcoders@chattyfig.figleaf.com > > To change your subscription options or search the archive: > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > Brought to you by Fig Leaf Software > > Premier Authorized Adobe Consulting and Training > > http://www.figleaf.com > > http://training.figleaf.com > > > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Okay, I have fixed the problem. I would say that this is certainly bug with Flash, but there is a work around. Thanks to Keith Peters for mentioning this to me last night. So here's the deal... Back in the day before MovieClipLoader when you wanted to load and external SWF, you had to check a property of the MovieClip to see if it existed before you could manipulate it. You needed to create an interval that would check to see if it's initialized in this way. This all makes sense to me, but what doesn't, is that you can't just check that any property of MovieClip was set. There is a magic property that seems to indicate that the MovieClip is fully initialized. That property is _width. So with this in mind I added a check to the onLoadProgress event like so: private function handleLoadProgress(targetMC:MovieClip, loadedBytes:Number, totalBytes:Number):Void { if (MovieAsset.HIDE_WHEN_LOADED) { if (targetMC._width != undefined || targetMC._width != 0) { targetMC._visible = false; } } } Now, how's that for obscure? It does fix the issue, and instanceof is indeed a MovieClip once again. Oh, and even better, _visible works like a charm. Thanks again to all those that helped out with this one. -Chris On 8/24/06, Chris Allen <[EMAIL PROTECTED]> wrote: Thanks for your help on this Ian. I'm not sure I understand all of what you found here, so let me summarize with some questions to see if I got it right. Flash 6 SWFs fail every time when loaded remotely? - This hasn't been my experience. I've been able to load some small ones (20K) without the issue. You think it may have to so with domain security in Flash? When loading from your files system the Flash 7 and 8 files load correctly but not Flash 6? Some findings I have made: The behavior is slightly different on a Macintosh versus a Windows machine. Which are you using? Altering nothing before the SWF is fully loaded screws up the instanceof stuff but all of the MovieClip properties work just fine. If I try to alter the _visible property before it's fully loaded it causes that property to no longer function once fully loaded. I have some other ideas to try out this morning and I will keep you posted on my progress. Thanks to all of you who tried to help. -Chris On 8/24/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > Oh, I should add - I get the same results when I throw the Fling code > out completely and write a simple loader from scratch. > > Cheers, > Ian > > On 8/24/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > > > I'm certainly running out of ideas for a simple fix, here - and it's > > definitely not the loading code, it's a 'feature' or bug in the Flash > > Player. > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Thanks for your help on this Ian. I'm not sure I understand all of what you found here, so let me summarize with some questions to see if I got it right. Flash 6 SWFs fail every time when loaded remotely? - This hasn't been my experience. I've been able to load some small ones (20K) without the issue. You think it may have to so with domain security in Flash? When loading from your files system the Flash 7 and 8 files load correctly but not Flash 6? Some findings I have made: The behavior is slightly different on a Macintosh versus a Windows machine. Which are you using? Altering nothing before the SWF is fully loaded screws up the instanceof stuff but all of the MovieClip properties work just fine. If I try to alter the _visible property before it's fully loaded it causes that property to no longer function once fully loaded. I have some other ideas to try out this morning and I will keep you posted on my progress. Thanks to all of you who tried to help. -Chris On 8/24/06, Ian Thomas <[EMAIL PROTECTED]> wrote: Oh, I should add - I get the same results when I throw the Fling code out completely and write a simple loader from scratch. Cheers, Ian On 8/24/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > I'm certainly running out of ideas for a simple fix, here - and it's > definitely not the loading code, it's a 'feature' or bug in the Flash > Player. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Oh, I should add - I get the same results when I throw the Fling code out completely and write a simple loader from scratch. Cheers, Ian On 8/24/06, Ian Thomas <[EMAIL PROTECTED]> wrote: I'm certainly running out of ideas for a simple fix, here - and it's definitely not the loading code, it's a 'feature' or bug in the Flash Player. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Okay, weirder and weirder: On my local machine loading from a local file, loading .swf v6 gives instanceof MovieClip=false and v7 and v8 give instanceof MovieClip=true. On a remote machine loading from that same remote machine, loading .swf v6 gives instanceof MovieClip=false and v7 and v8 give instanceof MovieClip=true. On my local machine loading from a remote machine, all versions give instanceof MovieClip=false. On a remote machine loading from a different remote machine, all versions give instanceof MovieClip=false. My initial thought is it must be a cross-domain scripting issue - i.e. the app wouldn't let you check the instanceof because of a domain scripting policy (see http://www.adobe.com/devnet/flash/articles/fplayer_security_04.html). But I've tested it with System.security.allowDomain() and checked scripting between the two movies, and even when cross-domain scripting works perfectly (no sandbox violations) the instanceof still returns false. (I'm not 100% sure whether I've got the System.security settings right - but I can read vars in the loaded movies and vice versa, so that sounds pretty correct to me.) I still think that's the most likely candidate - that it's _something_ to do with the sandbox/security system getting in the way. After all, a common feature is that v6 .swfs fail all the time - and we already know that a v6 movie can never share a global object with a v7 or v8 movie. I'm certainly running out of ideas for a simple fix, here - and it's definitely not the loading code, it's a 'feature' or bug in the Flash Player. Hope some of this helps! Cheers, Ian On 8/23/06, John Grden <[EMAIL PROTECTED]> wrote: cool, thanks Ian, I'll try the same tests with published swf's Really appreciate your help! ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
cool, thanks Ian, I'll try the same tests with published swf's Really appreciate your help! On 8/23/06, Ian Thomas <[EMAIL PROTECTED]> wrote: Weird. It's very reproducible here - I've tried varying sizes between 1Kb and 200Kb. They all fail if published to FP6, but work if published to FP7 and FP8 (the loader movie itself I've tested published to FP7 and FP8). I haven't tested a remote FP8 file, as I don't have one to hand. Gonna have to sign off now, but I'll try out some more scenarios tomorrow. Cheers, Ian On 8/23/06, John Grden <[EMAIL PROTECTED]> wrote: > wow, no infact, that confuses me ;) I've been loading Flash8 and 7 files > and they've failed along with the version 6 swf's. > > If I load the Fp8 version locally, it seems to work, but from a web server, > it seems to not. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- [ JPG ] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Weird. It's very reproducible here - I've tried varying sizes between 1Kb and 200Kb. They all fail if published to FP6, but work if published to FP7 and FP8 (the loader movie itself I've tested published to FP7 and FP8). I haven't tested a remote FP8 file, as I don't have one to hand. Gonna have to sign off now, but I'll try out some more scenarios tomorrow. Cheers, Ian On 8/23/06, John Grden <[EMAIL PROTECTED]> wrote: wow, no infact, that confuses me ;) I've been loading Flash8 and 7 files and they've failed along with the version 6 swf's. If I load the Fp8 version locally, it seems to work, but from a web server, it seems to not. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
wow, no infact, that confuses me ;) I've been loading Flash8 and 7 files and they've failed along with the version 6 swf's. If I load the Fp8 version locally, it seems to work, but from a web server, it seems to not. On 8/23/06, Ian Thomas <[EMAIL PROTECTED]> wrote: Hi John, Yeah, I've now tried it with a bunch of random downloaded movies and managed to get some to fail. I think I've nailed it - or at least, one thing that produces the problem. At least on my system - if you load in a .swf version 7 or 8, it works fine. If you load in a .swf version 6, the instanceof returns false. Does that get things any further..? Ian On 8/23/06, John Grden <[EMAIL PROTECTED]> wrote: > Hey Ian, try loading something off of a web server thats takes at least a > second or 2 to load > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- [ JPG ] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Hi John, Yeah, I've now tried it with a bunch of random downloaded movies and managed to get some to fail. I think I've nailed it - or at least, one thing that produces the problem. At least on my system - if you load in a .swf version 7 or 8, it works fine. If you load in a .swf version 6, the instanceof returns false. Does that get things any further..? Ian On 8/23/06, John Grden <[EMAIL PROTECTED]> wrote: Hey Ian, try loading something off of a web server thats takes at least a second or 2 to load ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Yes, we've tested with several SWF's varying in size and target player (6-8) On 8/23/06, Johannes Nel <[EMAIL PROTECTED]> wrote: also what bout the content you are loading in, have you tried changing that? On 8/23/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > > Hi Chris, > I've tried that (with a bit tweaking for syntax errors) and it all > works fine - instanceof returns the correct results. This is loading a > clip I created from scratch (Flash 8, WinXP) - if you have a sample > clip I can try that's failing for you, that's be good. > > However, I did have to correct the trace statements: > > trace("Is this a movieclip:"+clip instanceof MovieClip); // Always > outputs 'false' > trace("Is this a movieclip:"+(clip instanceof MovieClip)); // Always > gives the correct answer. > > It's not something as simple and silly as that, is it? I assume not. :-) > > Cheers, > Ian > > On 8/23/06, Chris Allen <[EMAIL PROTECTED]> wrote: > > Hi Ian, > > > > Thanks for looking into this. > > > > I did indeed try running it with Flash compiling. Try this in an FLA > > and you should see the same results: > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- [ JPG ] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Hey Ian, try loading something off of a web server thats takes at least a second or 2 to load On 8/23/06, Ian Thomas <[EMAIL PROTECTED]> wrote: Hi Chris, I've tried that (with a bit tweaking for syntax errors) and it all works fine - instanceof returns the correct results. This is loading a clip I created from scratch (Flash 8, WinXP) - if you have a sample clip I can try that's failing for you, that's be good. However, I did have to correct the trace statements: trace("Is this a movieclip:"+clip instanceof MovieClip); // Always outputs 'false' trace("Is this a movieclip:"+(clip instanceof MovieClip)); // Always gives the correct answer. It's not something as simple and silly as that, is it? I assume not. :-) Cheers, Ian On 8/23/06, Chris Allen <[EMAIL PROTECTED]> wrote: > Hi Ian, > > Thanks for looking into this. > > I did indeed try running it with Flash compiling. Try this in an FLA > and you should see the same results: ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- [ JPG ] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Oh, I should add, this is after I commented out the line: if(targetMC instanceof MovieClip == false) targetMC.__proto__ = new MovieClip(); from MovieAssets - which I assume was your temporary hack to fix things. It all works for me without this line. Cheers, Ian On 8/23/06, Ian Thomas <[EMAIL PROTECTED]> wrote: Hi Chris, I've tried that (with a bit tweaking for syntax errors) and it all works fine - instanceof returns the correct results. This is loading a clip I created from scratch (Flash 8, WinXP) - if you have a sample clip I can try that's failing for you, that's be good. However, I did have to correct the trace statements: trace("Is this a movieclip:"+clip instanceof MovieClip); // Always outputs 'false' trace("Is this a movieclip:"+(clip instanceof MovieClip)); // Always gives the correct answer. It's not something as simple and silly as that, is it? I assume not. :-) Cheers, Ian ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
also what bout the content you are loading in, have you tried changing that? On 8/23/06, Ian Thomas <[EMAIL PROTECTED]> wrote: Hi Chris, I've tried that (with a bit tweaking for syntax errors) and it all works fine - instanceof returns the correct results. This is loading a clip I created from scratch (Flash 8, WinXP) - if you have a sample clip I can try that's failing for you, that's be good. However, I did have to correct the trace statements: trace("Is this a movieclip:"+clip instanceof MovieClip); // Always outputs 'false' trace("Is this a movieclip:"+(clip instanceof MovieClip)); // Always gives the correct answer. It's not something as simple and silly as that, is it? I assume not. :-) Cheers, Ian On 8/23/06, Chris Allen <[EMAIL PROTECTED]> wrote: > Hi Ian, > > Thanks for looking into this. > > I did indeed try running it with Flash compiling. Try this in an FLA > and you should see the same results: ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- j:pn http://www.lennel.org ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Hi Chris, I've tried that (with a bit tweaking for syntax errors) and it all works fine - instanceof returns the correct results. This is loading a clip I created from scratch (Flash 8, WinXP) - if you have a sample clip I can try that's failing for you, that's be good. However, I did have to correct the trace statements: trace("Is this a movieclip:"+clip instanceof MovieClip); // Always outputs 'false' trace("Is this a movieclip:"+(clip instanceof MovieClip)); // Always gives the correct answer. It's not something as simple and silly as that, is it? I assume not. :-) Cheers, Ian On 8/23/06, Chris Allen <[EMAIL PROTECTED]> wrote: Hi Ian, Thanks for looking into this. I did indeed try running it with Flash compiling. Try this in an FLA and you should see the same results: ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
On 8/23/06, Ian Thomas <[EMAIL PROTECTED]> wrote: Hi Chris, Having had a trawl through the source code, I see what you're getting at. The fact that MovieAsset doesn't extend MovieClip is nothing to do with the problem; MovieAsset wraps a MovieClip property and passes that back, and that should be fine. I've no idea where it's going wrong, I'm afraid - the code all looks sane and clean to me. Did you say you're only getting this issue from MTASC compiled .swfs..? Ian Hi Ian, Thanks for looking into this. I did indeed try running it with Flash compiling. Try this in an FLA and you should see the same results: import org.osflash.fling.util.assets.MovieAsset; MovieAsset.setHideWhenLoaded(true); var asset:MovieAsset = new MovieAsset(); asset.addEventListener(AssetLoader.ASSETLOADCOMPLETE, Delegate.create(this, handleAssetComplete)); asset.addEventListener(AssetLoader.ASSETLOADPROGRESS, Delegate.create(this, handleAssetProgress)); asset.addEventListener(AssetLoader.ASSETLOADERROR, Delegate.create(this, handleAssetError)); asset.setName("testMovie"); asset.setAutoCreateContainer(true); var mc:MovieClip = _level0.createEmptyMovieClip("testHolder_mc", _level0.getNextHighestDepth()); asset.setTarget(mc); asset.setSource("testassets/test.swf"); asset.load(); function handleAssetComplete(eventObj:Object):Void { trace("loaded"); trace("Movie: " + asset.getResource()); var movie:MovieClip = MovieClip(asset.getResource()); movie._visible = true; } function handleAssetProgress(eventObj:Object):Void { trace("bytesLoaded: " + eventObj.loadedBytes + " totalBytes: " + eventObj.totalBytes + " for " + eventObj.assetName); } function handleAssetError(eventObj:Object) :Void { trace (eventObj.message); } ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Hi Chris, Having had a trawl through the source code, I see what you're getting at. The fact that MovieAsset doesn't extend MovieClip is nothing to do with the problem; MovieAsset wraps a MovieClip property and passes that back, and that should be fine. I've no idea where it's going wrong, I'm afraid - the code all looks sane and clean to me. Did you say you're only getting this issue from MTASC compiled .swfs..? Ian On 8/23/06, Chris Allen <[EMAIL PROTECTED]> wrote: Sounds good guys! One minor update to think about before we are at the pub though. The problem only occurs when loading a rather large SWF. If it's a small one (20k or so) or it's on my local computer, then the MovieClip loads up, it is an actual MovieClip and all of the properties including _visible work just fine. I'm assuming that is because enough of it is loaded to be a full fledged MovieClip with these case so that calling movie._visible inside of the onLoadStart() method doesn't cause any problems. I'm not sure what extending MovieClip has to do with this situation, nor am I sure that it's feasible in my case, but I would love to hear your thoughts. See you guys soon! U beer... -Chris ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
Sounds good guys! One minor update to think about before we are at the pub though. The problem only occurs when loading a rather large SWF. If it's a small one (20k or so) or it's on my local computer, then the MovieClip loads up, it is an actual MovieClip and all of the properties including _visible work just fine. I'm assuming that is because enough of it is loaded to be a full fledged MovieClip with these case so that calling movie._visible inside of the onLoadStart() method doesn't cause any problems. I'm not sure what extending MovieClip has to do with this situation, nor am I sure that it's feasible in my case, but I would love to hear your thoughts. See you guys soon! U beer... -Chris On 8/23/06, Peter Hall <[EMAIL PROTECTED]> wrote: Yes. Beer. See you then. Peter On 8/23/06, Johannes Nel <[EMAIL PROTECTED]> wrote: > yeah, i think i agree with peter that the problem is then that you do not > extend movieclip. we can get semantic about this tonight, but only once we > have a beer in hand... > > ;) > > On 8/23/06, Chris Allen <[EMAIL PROTECTED]> wrote: > > > > On 8/23/06, Peter Hall <[EMAIL PROTECTED]> wrote: > > > Perhaps you have a class associated with the symbol, which does not > > > extend MovieClip? > > > > > Well the instance of MovieClip, or whatever it is in this case, is a > > part of a class that doesn't extend MovieClip (MovieAsset). MovieAsset > > implemts and Asset interface and extends an AbstractAsset class that > > does much of the general leg work. The MovieAsset class has a method > > getResource() that returns an Object, in this particular case it's the > > MovieClip in question. So when accessing this MovieClip using this > > class you must call getResource() and cast it to MovieClip: > > > > var movie:MovieClip = MovieClip(asset.getResource()); > > movie._visible = true; > > > > You can take a look at what we are working on here: > > > > http://svn1.cvsdude.com/osflash/fling/DEV_Source/classes/org/osflash/fling/util/assets/ > > > > To replicate the problem you have to set > > MovieAsset.setHideWhenLoaded(true); then once the loadComplete event > > is triggered you try to set the MovieClip to visible: > > MovieClip(asset.getResource())._visible = true; > > > > You should then see that it doesn't work. > > > > Thanks for your help! > > > > -Chris > > ___ > > Flashcoders@chattyfig.figleaf.com > > To change your subscription options or search the archive: > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > Brought to you by Fig Leaf Software > > Premier Authorized Adobe Consulting and Training > > http://www.figleaf.com > > http://training.figleaf.com > > > > > > -- > j:pn > http://www.lennel.org > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
BTW, there is a unit test to recreate the problem. It can be found here: http://svn1.cvsdude.com/osflash/fling/DEV_Source/classes/org/osflash/fling/tests/TestMovieAsset.as See testShowMovie() -Chris On 8/23/06, Chris Allen <[EMAIL PROTECTED]> wrote: On 8/23/06, Peter Hall <[EMAIL PROTECTED]> wrote: > Perhaps you have a class associated with the symbol, which does not > extend MovieClip? > Well the instance of MovieClip, or whatever it is in this case, is a part of a class that doesn't extend MovieClip (MovieAsset). MovieAsset implemts and Asset interface and extends an AbstractAsset class that does much of the general leg work. The MovieAsset class has a method getResource() that returns an Object, in this particular case it's the MovieClip in question. So when accessing this MovieClip using this class you must call getResource() and cast it to MovieClip: var movie:MovieClip = MovieClip(asset.getResource()); movie._visible = true; You can take a look at what we are working on here: http://svn1.cvsdude.com/osflash/fling/DEV_Source/classes/org/osflash/fling/util/assets/ To replicate the problem you have to set MovieAsset.setHideWhenLoaded(true); then once the loadComplete event is triggered you try to set the MovieClip to visible: MovieClip(asset.getResource())._visible = true; You should then see that it doesn't work. Thanks for your help! -Chris ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: Re: Re: [Flashcoders] Misreporting instanceof operator.
On 8/23/06, Johannes Nel <[EMAIL PROTECTED]> wrote: seeing you at the meeting tonight i take it :) Yeah! Definitely. this is a world of pain by the looks of it... have you tried loading it in without a loader, rather old style target.load(path) and see if that solves the problem. i have had some weirdness in flex1.5 with loading content as well and hacking it like this (which makes my stomach churn) has had the desired result. We tried the MovieClip.loadMovie() way of doing things and it had the same result. I assume that's what you are talking about. We are certainly dealing with one of those weird voodoo areas of Flash, so thanks for the sympathy. ;-) On 8/23/06, Chris Allen <[EMAIL PROTECTED]> wrote: > > Hi Johannes, > > Welcome back to Boston! (I didn't get a chance to say so on the BFPUG > list) > > On 8/23/06, Johannes Nel <[EMAIL PROTECTED]> wrote: > > thats quite a hack. a normal cast then returns null i assume? > > > Yeah that's quite a hack indeed! We are casting the thing with a > normal cast as well and it just yields the same results; it doesn't > show up as null though. Even with the hack it's not allowing us to > manipulate the _visible property, or at least it doesn't show any > effect when viewed in the Flash player. > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com