Re: [Flashcoders] Problem when loading swf a second time
Thanks for the replies. I figured out the problem, it was from overriding the MovieClip prototype from within a loaded clip, and then reloading the clip a second time. Here's a blog post that discusses the issue of using hitTest in loaded swfs ( i.e., x,y coordinates must be in global not local coordinates), and a workaround for overriding the prototype... http://www.bit-101.com/blog/?p=499 The workaround... MovieClip.prototype.oldHitTest = MovieClip.prototype.hitTest; MovieClip.prototype.hitTest = function(x, y, sf){ var obj = {x:x, y:y}; this._parent.localToGlobal(obj); return this.oldHitTest(obj.x , obj.y, sf); } That works great, unless the swf gets loaded a second time. Here's what I changed and everything is rosey again... if(!MovieClip.prototype.oldHitTest) { MovieClip.prototype.oldHitTest = MovieClip.prototype.hitTest; MovieClip.prototype.hitTest = function(x, y, sf) { var obj = {x:x, y:y}; this._parent.localToGlobal(obj); return this.oldHitTest(obj.x, obj.y, sf); }; } Thanks to everyone who responded. And to all those who are complaining about receiving so many messages from the mail list: you're not really helping matters. On 2/24/07, Hans Wichman [EMAIL PROTECTED] wrote: Hi, can you check if these singletons are in the correct state? For example, although not entirely how they were meant to be, but if you add a MySingleton.reset() method, which causes the first getInstance() to return a NEW instance (so reset clears the static _instance), is the problem solved? So eg each of your singletons gets a static method reset and it resets the single instance it wraps. Before you load the new game you call these reset methods. Might be worth a shot. greetz JC On 2/24/07, Jay Bibby [EMAIL PROTECTED] wrote: Thanks Hans, _root._name is exactly what I expect in both circumstances. However, yes, the shell uses a GameManager, and a LoadManager, both of which are singletons. Funny thing is, this is my 2nd time around with this shell. I had previously created one for 21 games that worked flawlessly. Now I get a game that breaks the system and I don't know what to try next. On 2/23/07, Hans Wichman [EMAIL PROTECTED] wrote: ps what also might be the case is that you are using static classes, singletons etc and that the whole mumbojumbo is not correctly initialized (or already 'used') the second time around. On 2/23/07, Hans Wichman [EMAIL PROTECTED] wrote: Hi, i had a similar problem last week. In my case, even though _lockroot was on, the second time I loaded a clip, the reference to _root suddenly pointed to the main _root again and not the subroot as it had to. Trace (_root) from the subclip to see whats happening. In my case I lost the reference somewhere around instantiating webservice, so as long as i stored it in another reference before creating the webservice, I was fine. hth JC On 2/23/07, Harris, Mike [EMAIL PROTECTED] wrote: What happens if you put ? and a random number after the name of the swf when you load it? Like, mymovie.swf ?343423 Mike This Message (including attachments) is intended only for the identified Recipient(s) and may contain information that is confidential or subject to copyright, trade secret or other restrictions. It may also include attorney client, attorney work product, or other privileged communications. The information and opinions presented in this Message do not necessarily represent those of the Jones Companies. If you are not the intended Recipient, you are hereby notified that any use, copying or distribution of this Message (including attachments) is unauthorized and prohibited. If you have received this Message in error, please notify the Sender ( [EMAIL PROTECTED]) immediately by replying to and then completely deleting the Message (including all attachments) from your computer. Additionally, the integrity and security of this Message and its attachments cannot be assured on the Internet; Recipients assume all risk of loss by accepting this message, including from their failure to use effective anti-virus software. -Original Message- From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] ] On Behalf Of Jay Bibby Sent: Friday, February 23, 2007 2:54 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Problem when loading swf a second time Hi, I'm at my wits end on this and I don't know where to turn for help. Numerous Google searches have turned up little in the way of anyone encountering a similar issue. I have an interface shell swf that handles the selection, loading and display of various external game swfs within it. All are loaded via a MovieClipLoader object and all of them have
[Flashcoders] Problem when loading swf a second time
Hi, I'm at my wits end on this and I don't know where to turn for help. Numerous Google searches have turned up little in the way of anyone encountering a similar issue. I have an interface shell swf that handles the selection, loading and display of various external game swfs within it. All are loaded via a MovieClipLoader object and all of them have _lockroot set to true. One particular game behaves fine when loaded the first time into the shell. But loaded a 2nd time, I get the following 256 levels of recursion error message... 256 levels of recursion were exceeded in one action list. This is probably an infinite loop. Further execution of actions has been disabled in this movie. The error occurs while the external swf is attaching a movieclip from its library... t = _root.attachMovie(title, title, 1000); I thought perhaps that it just might be a timing issue, since loading the swf a second time is virtually instantaneous, even though I wait until the MovieClipLoader's listener object receives the onLoadInit call before allowing the loaded swf to continue. So I created several delays in the swf, via timeouts and also by extending the main timeline. Doing so actually seemed to fix the problem. The title screen was created and the start button on it was functional. Subsequently starting the game created the first puzzle and all seemed good until one of the objects in the first puzzle was clicked on... then the same recursion error. I'm at my wits end. To recap: The game functions perfectly the first time it is loaded. However, after unloading the swf and reloading it again, the same swf seems to be unstable. Has anyone seen similar behavior before when using externally loaded swfs? Or do you have any ideas as to what to look for in the code? Thanks very much. Jay jayisgames.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: [Flashcoders] Problem when loading swf a second time
Thanks, Mike for the reply. Problem with doing that is the loader then can't seem to find the file... Error opening URL file:///.../puzzle3.swf?487 It was worth a try, though. On 2/23/07, Harris, Mike [EMAIL PROTECTED] wrote: What happens if you put ? and a random number after the name of the swf when you load it? Like, mymovie.swf?343423 Mike -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jay Bibby Sent: Friday, February 23, 2007 2:54 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Problem when loading swf a second time Hi, I'm at my wits end on this and I don't know where to turn for help. Numerous Google searches have turned up little in the way of anyone encountering a similar issue. I have an interface shell swf that handles the selection, loading and display of various external game swfs within it. All are loaded via a MovieClipLoader object and all of them have _lockroot set to true. One particular game behaves fine when loaded the first time into the shell. But loaded a 2nd time, I get the following 256 levels of recursion error message... 256 levels of recursion were exceeded in one action list. This is probably an infinite loop. Further execution of actions has been disabled in this movie. The error occurs while the external swf is attaching a movieclip from its library... t = _root.attachMovie(title, title, 1000); I thought perhaps that it just might be a timing issue, since loading the swf a second time is virtually instantaneous, even though I wait until the MovieClipLoader's listener object receives the onLoadInit call before allowing the loaded swf to continue. So I created several delays in the swf, via timeouts and also by extending the main timeline. Doing so actually seemed to fix the problem. The title screen was created and the start button on it was functional. Subsequently starting the game created the first puzzle and all seemed good until one of the objects in the first puzzle was clicked on... then the same recursion error. I'm at my wits end. To recap: The game functions perfectly the first time it is loaded. However, after unloading the swf and reloading it again, the same swf seems to be unstable. Has anyone seen similar behavior before when using externally loaded swfs? Or do you have any ideas as to what to look for in the code? Thanks very much. Jay jayisgames.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: [Flashcoders] Problem when loading swf a second time
So I uploaded the same files (with the random query string attached to the filename for loading) to a server and tried it remotely, and the swfs were loaded, and reloaded again -- it did not appear to have fetched it from cache the second time. However, the same problem persists: recursion error. It seems so illogical. And so frustrating. On 2/23/07, Jay Bibby [EMAIL PROTECTED] wrote: Thanks, Mike for the reply. Problem with doing that is the loader then can't seem to find the file... Error opening URL file:///.../puzzle3.swf?487 It was worth a try, though. On 2/23/07, Harris, Mike [EMAIL PROTECTED] wrote: What happens if you put ? and a random number after the name of the swf when you load it? Like, mymovie.swf?343423 Mike -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf Of Jay Bibby Sent: Friday, February 23, 2007 2:54 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Problem when loading swf a second time Hi, I'm at my wits end on this and I don't know where to turn for help. Numerous Google searches have turned up little in the way of anyone encountering a similar issue. I have an interface shell swf that handles the selection, loading and display of various external game swfs within it. All are loaded via a MovieClipLoader object and all of them have _lockroot set to true. One particular game behaves fine when loaded the first time into the shell. But loaded a 2nd time, I get the following 256 levels of recursion error message... 256 levels of recursion were exceeded in one action list. This is probably an infinite loop. Further execution of actions has been disabled in this movie. The error occurs while the external swf is attaching a movieclip from its library... t = _root.attachMovie(title, title, 1000); I thought perhaps that it just might be a timing issue, since loading the swf a second time is virtually instantaneous, even though I wait until the MovieClipLoader's listener object receives the onLoadInit call before allowing the loaded swf to continue. So I created several delays in the swf, via timeouts and also by extending the main timeline. Doing so actually seemed to fix the problem. The title screen was created and the start button on it was functional. Subsequently starting the game created the first puzzle and all seemed good until one of the objects in the first puzzle was clicked on... then the same recursion error. I'm at my wits end. To recap: The game functions perfectly the first time it is loaded. However, after unloading the swf and reloading it again, the same swf seems to be unstable. Has anyone seen similar behavior before when using externally loaded swfs? Or do you have any ideas as to what to look for in the code? Thanks very much. Jay jayisgames.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: [Flashcoders] Problem when loading swf a second time
Thanks Hans, _root._name is exactly what I expect in both circumstances. However, yes, the shell uses a GameManager, and a LoadManager, both of which are singletons. Funny thing is, this is my 2nd time around with this shell. I had previously created one for 21 games that worked flawlessly. Now I get a game that breaks the system and I don't know what to try next. On 2/23/07, Hans Wichman [EMAIL PROTECTED] wrote: ps what also might be the case is that you are using static classes, singletons etc and that the whole mumbojumbo is not correctly initialized (or already 'used') the second time around. On 2/23/07, Hans Wichman [EMAIL PROTECTED] wrote: Hi, i had a similar problem last week. In my case, even though _lockroot was on, the second time I loaded a clip, the reference to _root suddenly pointed to the main _root again and not the subroot as it had to. Trace (_root) from the subclip to see whats happening. In my case I lost the reference somewhere around instantiating webservice, so as long as i stored it in another reference before creating the webservice, I was fine. hth JC On 2/23/07, Harris, Mike [EMAIL PROTECTED] wrote: What happens if you put ? and a random number after the name of the swf when you load it? Like, mymovie.swf ?343423 Mike This Message (including attachments) is intended only for the identified Recipient(s) and may contain information that is confidential or subject to copyright, trade secret or other restrictions. It may also include attorney client, attorney work product, or other privileged communications. The information and opinions presented in this Message do not necessarily represent those of the Jones Companies. If you are not the intended Recipient, you are hereby notified that any use, copying or distribution of this Message (including attachments) is unauthorized and prohibited. If you have received this Message in error, please notify the Sender ( [EMAIL PROTECTED]) immediately by replying to and then completely deleting the Message (including all attachments) from your computer. Additionally, the integrity and security of this Message and its attachments cannot be assured on the Internet; Recipients assume all risk of loss by accepting this message, including from their failure to use effective anti-virus software. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf Of Jay Bibby Sent: Friday, February 23, 2007 2:54 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Problem when loading swf a second time Hi, I'm at my wits end on this and I don't know where to turn for help. Numerous Google searches have turned up little in the way of anyone encountering a similar issue. I have an interface shell swf that handles the selection, loading and display of various external game swfs within it. All are loaded via a MovieClipLoader object and all of them have _lockroot set to true. One particular game behaves fine when loaded the first time into the shell. But loaded a 2nd time, I get the following 256 levels of recursion error message... 256 levels of recursion were exceeded in one action list. This is probably an infinite loop. Further execution of actions has been disabled in this movie. The error occurs while the external swf is attaching a movieclip from its library... t = _root.attachMovie(title, title, 1000); I thought perhaps that it just might be a timing issue, since loading the swf a second time is virtually instantaneous, even though I wait until the MovieClipLoader's listener object receives the onLoadInit call before allowing the loaded swf to continue. So I created several delays in the swf, via timeouts and also by extending the main timeline. Doing so actually seemed to fix the problem. The title screen was created and the start button on it was functional. Subsequently starting the game created the first puzzle and all seemed good until one of the objects in the first puzzle was clicked on... then the same recursion error. I'm at my wits end. To recap: The game functions perfectly the first time it is loaded. However, after unloading the swf and reloading it again, the same swf seems to be unstable. Has anyone seen similar behavior before when using externally loaded swfs? Or do you have any ideas as to what to look for in the code? Thanks very much. Jay jayisgames.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
Re: [Flashcoders] flv question
Stephen, Just go to http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Enter your email address at the bottom next to the button Unsubscribe or edit options On the next page (you may have to enter your password first) scroll down until you see... *Set Digest Mode Make sure that is set to ON and you won't receive an email for every post. (That's what I had to do after a previous message from the list owner said that problems with the list caused personal settings to be lost.) * On 2/23/07, Stephen Smith [EMAIL PROTECTED] wrote: Can we get all the emails to stop today? Stephen W. Smith VP Corporate Development RichFX, Inc. 512 7th Avenue, 16th Floor New York, NY 10018 p: (646) 274-3908 f: (646) 274-7302 mailto:[EMAIL PROTECTED] email www.richfx.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mango, Connie Sent: Friday, February 23, 2007 6:26 PM To: flashcoders@chattyfig.figleaf.com; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [Flashcoders] flv question I downloaded the fill out the form version and it doesn't work. It looks great, but it doesn't play any .flv's Connie Mango Lead Designer Newsday.com 631-843-3525 [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Harris, Mike Sent: Friday, February 23, 2007 5:46 PM To: [EMAIL PROTECTED]; flashcoders@chattyfig.figleaf.com; [EMAIL PROTECTED] Subject: RE: [Flashcoders] flv question Here is another player, that doesn't ask you to fill out a form before downloading. http://www.martijndevisser.com/blog/article/flv-player-updated Mike This Message (including attachments) is intended only for the identified Recipient(s) and may contain information that is confidential or subject to copyright, trade secret or other restrictions. It may also include attorney client, attorney work product, or other privileged communications. The information and opinions presented in this Message do not necessarily represent those of the Jones Companies. If you are not the intended Recipient, you are hereby notified that any use, copying or distribution of this Message (including attachments) is unauthorized and prohibited. If you have received this Message in error, please notify the Sender ([EMAIL PROTECTED]) immediately by replying to and then completely deleting the Message (including all attachments) from your computer. Additionally, the integrity and security of this Message and its attachments cannot be assured on the Internet; Recipients assume all risk of loss by accepting this message, including from their failure to use effective anti-virus software. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of johnteal Sent: Friday, February 23, 2007 3:31 PM To: [EMAIL PROTECTED]; Flashcoders@chattyfig.figleaf.com Subject: re: [Flashcoders] flv question Sorry, no browser can view an FLV file on its own. However, here's a link to download a free desktop player. You can then drag-n-drop the file onto the player and view your FLV. Hope this helps. http://www.vitalstream.com/tools/player-web.asp John Teal From: Gustavo Duenas [EMAIL PROTECTED] Sent: Friday, February 23, 2007 12:39 PM To: Flashcoders mailing list Flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] flv question hi, do you kbnow if any browser can see a .flv file without the need of being embeded into a html or flash ? it appears to not. regards Gustavo Duenas ___ 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 ___ 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: [Flashcoders] htacess and loaded SWFs
Cheers, Haikal! That's just the information I was looking for. Let's hope they change that soon. regards, Jay -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Haikal Saadh Sent: Monday, 21 August 2006 1:51 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] htacess and loaded SWFs This would be why: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=b06f1712 Currently the SWF format does not include HTTP referrer information when sending http requests. Macromedia is aware of this issue and is considering possible future solutions. Jay Bibby wrote: Hi folks, I've spent all evening trying to find an answer to this question, and I've just recently subscribed to this list, so I apologize in advance if this has already been covered. I have set up a directory to serve up SWFs from with an htaccess file that prevents direct access to the SWFs or from domains other than my own. This is working fine... when an HTML or PHP file on my domain is the file that is loading the SWF. However, when the same HTML or PHP file loads a SWF that then tries to load another SWF from the same directory, htaccess prevents it. I am using a MovieClipLoader to load the external SWF. How is loading a SWF from within a SWF different to Apache than loading the same SWF from an HTML or PHP file? I'm pulling my hair out here. Thanks in advance. Jay ___ 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 -- Haikal Saadh Applications Programmer ICT Resources, TALSS QUT Kelvin Grove ___ 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] htacess and loaded SWFs
Hi folks, I've spent all evening trying to find an answer to this question, and I've just recently subscribed to this list, so I apologize in advance if this has already been covered. I have set up a directory to serve up SWFs from with an htaccess file that prevents direct access to the SWFs or from domains other than my own. This is working fine... when an HTML or PHP file on my domain is the file that is loading the SWF. However, when the same HTML or PHP file loads a SWF that then tries to load another SWF from the same directory, htaccess prevents it. I am using a MovieClipLoader to load the external SWF. How is loading a SWF from within a SWF different to Apache than loading the same SWF from an HTML or PHP file? I'm pulling my hair out here. Thanks in advance. Jay ___ 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