Carnou
asked on
Local Storage popup doesn't popup
I'm coding in AS3, compiling using Flash CS4. I'm testing using IE8.
My code needs to store very large files using sharedObject, and I had it set up and working so that on startup, the program would call sharedObject.flush with a number larger than 10M to get the user's approval. It worked a month ago, but no longer does. Here's the data I've observed so far:
If I use the latest version of Flash player for IE, the local storage pop up never appears. My call to flush returns "pending", and the SharedObjectFlushEvent is instantly dispatched with a level of "error" and a code of "SharedObject.Flush.Failed ". If this is the first time I run, my limit is automatically set to the user's global storage setting of default size.
If I uninstall that version, and install the debug player from c:\Program Files\Adobe\Adobe Flash CS4\Players\Debug\Install Flash Player 10 ActiveX.exe, I get different results. The local storage setting pop up does pop up, but the accept/deny buttons don't work. It feels like I can click on them - the skin changes when I push the mouse button, but the pop up never disappears. The help icon works, but the other buttons don't.
I've looked at adobe's page on System.Security, and seeing it, I hooked up showSettings to a button. When I click the button, I get similar results. Using the newest Flash player, the pop up never appears, though trace statements show that I call showSettings. Using the debug Flash player, the pop up appears, but I can't drag the bar to change the size, and I can't click on "never ask again." The close button, however, works.
When I run the sample code from adobe for using showSettings, everything works fine, whether I run standalone or in IE.
I'm sure I'm missing something simple, but what? Is there some setting in the html file that prevents me from using either setting dialog?
Any help would be great!
My code needs to store very large files using sharedObject, and I had it set up and working so that on startup, the program would call sharedObject.flush with a number larger than 10M to get the user's approval. It worked a month ago, but no longer does. Here's the data I've observed so far:
If I use the latest version of Flash player for IE, the local storage pop up never appears. My call to flush returns "pending", and the SharedObjectFlushEvent is instantly dispatched with a level of "error" and a code of "SharedObject.Flush.Failed
If I uninstall that version, and install the debug player from c:\Program Files\Adobe\Adobe Flash CS4\Players\Debug\Install Flash Player 10 ActiveX.exe, I get different results. The local storage setting pop up does pop up, but the accept/deny buttons don't work. It feels like I can click on them - the skin changes when I push the mouse button, but the pop up never disappears. The help icon works, but the other buttons don't.
I've looked at adobe's page on System.Security, and seeing it, I hooked up showSettings to a button. When I click the button, I get similar results. Using the newest Flash player, the pop up never appears, though trace statements show that I call showSettings. Using the debug Flash player, the pop up appears, but I can't drag the bar to change the size, and I can't click on "never ask again." The close button, however, works.
When I run the sample code from adobe for using showSettings, everything works fine, whether I run standalone or in IE.
I'm sure I'm missing something simple, but what? Is there some setting in the html file that prevents me from using either setting dialog?
Any help would be great!
ASKER
Thanks, r3nder. That's one of the main articles I used to get my caching system running in the first place. My problem for the moment is the very odd behavior of the pop up windows that let the user resize. The fact that they're not displaying but instantly return a value of Failed is preventing me from taking advantage of all the tricks on that website. Until I can get it to ask the user for more space the way it's supposed to, knowing how to write to and read from the shared space won't help.
Any ideas for that?
Thanks!
Any ideas for that?
Thanks!
Have you done this Carnou
import the shared object
Create a variable for the shared object using getLocal
pass the username to the data tag
then trace the size to show it is bigger - see if that works
an example:
import flash.net.SharedObject;
var thisShadow:SharedObject = SharedObject.getLocal("myd ata");
thisShadow.data.username = "ashadow";
trace(thisShadow.size); // 62
I have never run into this issue so I am just spitballing it :)
Is it hot in Houston - I am just north of you in Lufkin (Dang hot here)
import the shared object
Create a variable for the shared object using getLocal
pass the username to the data tag
then trace the size to show it is bigger - see if that works
an example:
import flash.net.SharedObject;
var thisShadow:SharedObject = SharedObject.getLocal("myd
thisShadow.data.username = "ashadow";
trace(thisShadow.size); // 62
I have never run into this issue so I am just spitballing it :)
Is it hot in Houston - I am just north of you in Lufkin (Dang hot here)
ASKER
Well, I haven't done that specific test, but I have had writing succeed - up to whatever limit is set. Problem is, all of my files are bigger than 100K - many are bigger than 10MB. So writing them only partway and then failing is bad.
The only problem for the moment is that the popup windows don't work properly. In the case of the newest Player, it's as if the popup gets hidden, but based on the debug player, it seems like the user doesn't have permission to modify these variables.
I don't know if it's hot here - the AC keeps me nice and cool. *:-]
Thanks for the spitball attempt. I've never seen this either, so I'm hoping someone will tell me to tweak the one thing I'm obviously not tweaking.
The only problem for the moment is that the popup windows don't work properly. In the case of the newest Player, it's as if the popup gets hidden, but based on the debug player, it seems like the user doesn't have permission to modify these variables.
I don't know if it's hot here - the AC keeps me nice and cool. *:-]
Thanks for the spitball attempt. I've never seen this either, so I'm hoping someone will tell me to tweak the one thing I'm obviously not tweaking.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great shot! And from all the details I've given, that's a perfectly valid reason. There's even official adobe documentation (for what that's worth) backing you up: from their page on sharedObject, it says: If your SWF file attempts to create or modify local shared objects, make sure that your SWF file is at least 215 pixels wide and at least 138 pixels high (the minimum dimensions for displaying the dialog box that prompts users to increase their local shared object storage limit). If your SWF file is smaller than these dimensions and an increase in the storage limit is required, SharedObject.flush() fails, returning SharedObjectFlushedStatus. PENDING and dispatching the netStatus event.
Bad news is, I was incomplete in my details - the stage size is 1200x700. :-(
This is one of the paths I've considered, though. I wondered if somehow the dialog was being hidden by something else on the stage. The behavior for the newest Flash Player acts as if the panel doesn't have room to display. But the behavior with the debug player makes it more likely that the value isn't allowed to be modified. I see other websites, and even others of my own product where the local storage pop up works as intended. It seems that only this specific swf is having this issue.
(My project for tonight will be backing out to a version that doesn't access the sharedObject, and seeing if I can get that working. Logic dictates that something in my code is making it fail. I should be able to take out all the pieces and put them back till it works.)
Bad news is, I was incomplete in my details - the stage size is 1200x700. :-(
This is one of the paths I've considered, though. I wondered if somehow the dialog was being hidden by something else on the stage. The behavior for the newest Flash Player acts as if the panel doesn't have room to display. But the behavior with the debug player makes it more likely that the value isn't allowed to be modified. I see other websites, and even others of my own product where the local storage pop up works as intended. It seems that only this specific swf is having this issue.
(My project for tonight will be backing out to a version that doesn't access the sharedObject, and seeing if I can get that working. Logic dictates that something in my code is making it fail. I should be able to take out all the pieces and put them back till it works.)
Sorry to here that. We use sharedobjects in our product and dont seem to have any issues - Well do me a favor and keep me informed - Sorry I couldnt help anymore than I did........I hate giving up. When I talk to some others I will mention your problem and let you know. - If it is possible post a snippet of the code. If not thats cool.
ASKER
Yeah, I've never seen this before. Unfortunately, by the time I've stripped out enough of the important code, I'll not have much left. That's basically the point I'm at now - cut it all down to the ultra basics, get it working, and put all the pieces back in until it breaks. If I'm lucky, I'll figure out what's causing the issue along the way.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Actually, I've got some sample code for you (and anyone/everyone else)!
In this zip file are 4 files.
Second, more important question is - what causes the difference between the two flas? At this point, I'm assuming the fla is broken somehow, and about to try simply creating a new fla that looks exactly the same. My guess is that the new fla will work fine.
I'd like to know what made fpl.fla go bad. I'm still sure there's a setting somewhere I can tweak. If I knew it, I'd rather do that than reconstruct the app. Of course, we've already spent two days trying to save the corrupted fla - had we realized that's what it was, we could've reconstructed the app much faster and easier.
Let me know how the zip file works out...
examples.zip
In this zip file are 4 files.
- The two SecurityEx related files are a literal copy-paste from http://www.adobe.com/lived
ocs/flash/ 9.0/Action ScriptLang RefV3/flas h/system/S ecurity.ht ml . It runs properly - clicking on the box makes the security panel pop up, and it's editable, whether I run within Flash CS4 clicking ctrl-shift-enter, run within Flash CS4 clicking ctrl-enter, or double click on the swf (or generate an html and run through that). - The fpl.fla and pcv.as don't work. If you run fpl.fla by clicking ctrl-enter in Flash CS4, it works fine - clicking on the button makes the security panel pop up, and it's editabe. But if you run by clicking ctrl-shift-enter, or run standalone or via an html, it fails.
Second, more important question is - what causes the difference between the two flas? At this point, I'm assuming the fla is broken somehow, and about to try simply creating a new fla that looks exactly the same. My guess is that the new fla will work fine.
I'd like to know what made fpl.fla go bad. I'm still sure there's a setting somewhere I can tweak. If I knew it, I'd rather do that than reconstruct the app. Of course, we've already spent two days trying to save the corrupted fla - had we realized that's what it was, we could've reconstructed the app much faster and easier.
Let me know how the zip file works out...
examples.zip
ASKER
Here's a further-cleaned up version of fpl.fla. We've now verified that the issue is with that fla itself - making a new version of the fla (rather than a copy) doesn't exhibit any of these issues. So, a solution will be for us to remake our fla.
fpl.fla
fpl.fla
ASKER
Update - I think we've found the issues.
First, publishing with hardware acceleration set to anything other than "None" disables the user settings. If you change that, the swf behaves appropriately in standalone mode.
Second, setting wmode in the html page that loads it to 'none' is necessary for it to work in a browser. Apparently, wmode affects and overrides the hardware rendering setting.
This was a mess, but I think that pretty much fixes it up!
First, publishing with hardware acceleration set to anything other than "None" disables the user settings. If you change that, the swf behaves appropriately in standalone mode.
Second, setting wmode in the html page that loads it to 'none' is necessary for it to work in a browser. Apparently, wmode affects and overrides the hardware rendering setting.
This was a mess, but I think that pretty much fixes it up!
Great job Carmou!
Carnou
Thank you very much!, and it was my pleasure to help you in any way I could.
R3nder
Thank you very much!, and it was my pleasure to help you in any way I could.
R3nder
they didnt assign the points though :( oh well thanks for everything. I am just glad you got your program running :)
ASKER
I think it will assign points tomorrow, when the question closes. I've not seen this before, but it probably came from me accepting my own answer and still trying to assign points. If you don't get the points after the question closes, bring it up to an admin's attention - I've left more than enough statement of my intent for them to resolve it. *:-]
ASKER
Hi, ModEErf,
My posting number 33487128 should be the accepted answer. I'm not sure how I tried to set it up last time, but I would split all the points for an assisted solution between 33481197 and 33482807. r3nder put a lot of time and consideration into helping me solve the problem, and the dialogue helped me. While those postings weren't the actual answer, they did help me get to the answer myself, and I wanted to make sure that r3nder got rewarded for the time and effort.
I'd be perfectly happy splitting the 500 points between 33481197 and 33482807 and rewarding an A. Please let me know how to proceed from this point.
Thanks.
My posting number 33487128 should be the accepted answer. I'm not sure how I tried to set it up last time, but I would split all the points for an assisted solution between 33481197 and 33482807. r3nder put a lot of time and consideration into helping me solve the problem, and the dialogue helped me. While those postings weren't the actual answer, they did help me get to the answer myself, and I wanted to make sure that r3nder got rewarded for the time and effort.
I'd be perfectly happy splitting the 500 points between 33481197 and 33482807 and rewarding an A. Please let me know how to proceed from this point.
Thanks.
http://jaycsantos.com/flash/the-trick-to-using-sharedobject/
This also pertains to AS1, 2 or 3 (mostly the same)
let me know how it works for you
R3nder