Solved

Local Storage popup doesn't popup

Posted on 2010-08-19
19
1,200 Views
Last Modified: 2013-11-12
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!
0
Comment
Question by:Carnou
  • 9
  • 8
19 Comments
 
LVL 6

Expert Comment

by:r3nder
ID: 33475963
This will help you a great deal - I know it did for me when it came to sharedObjects
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
0
 
LVL 10

Author Comment

by:Carnou
ID: 33477093
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!
0
 
LVL 6

Expert Comment

by:r3nder
ID: 33480293
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("mydata");
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)
0
 
LVL 10

Author Comment

by:Carnou
ID: 33480857
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.
0
 
LVL 6

Accepted Solution

by:
r3nder earned 250 total points
ID: 33481197
Think I found it - it is an intriguing problem so I thought I would dig a little more - under
Prompting user to allow saving of shared-objects or to ask for more space:
It describes the problem you are having "the popup doesn’t work properly"

http://www.permadi.com/tutorial/flashSharedObject/index.html

0
 
LVL 10

Author Comment

by:Carnou
ID: 33481261
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.)
0
 
LVL 6

Expert Comment

by:r3nder
ID: 33481743
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.
0
 
LVL 10

Author Comment

by:Carnou
ID: 33482160
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.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 6

Assisted Solution

by:r3nder
r3nder earned 250 total points
ID: 33482807
try this
package {

  import com.actionscriptbible.Example;

  import flash.events.NetStatusEvent;

  import flash.net.SharedObject;

  import flash.net.SharedObjectFlushStatus;



  public class ch29ex2 extends Example {

    protected var so:SharedObject;

    

    public function ch29ex2() {

      so = SharedObject.getLocal("storage");

      

      //request 10 MB up front

      if (so.flush(10240 * 10240) == SharedObjectFlushStatus.PENDING) {

        so.addEventListener(NetStatusEvent.NET_STATUS, onUserAction);

        trace("User approval pending...");

      }

    }

    

    public function onUserAction(event:NetStatusEvent):void {

      so.removeEventListener(NetStatusEvent.NET_STATUS, onUserAction);

      switch (event.info.code) {

        case "SharedObject.Flush.Success":

          trace("Accepted");

          break;

        case "SharedObject.Flush.Failed":

          trace("Denied");

          //do error recovery

          break;

      }

    }

  }

}

Open in new window

0
 
LVL 10

Author Comment

by:Carnou
ID: 33485719
Actually, I've got some sample code for you (and anyone/everyone else)!
In this zip file are 4 files.
  • The two SecurityEx related files are a literal copy-paste from http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/system/Security.html .  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.
First question, I guess, is do you see the same results?  I've already tested on one other person's computer, and he saw what I saw, but verification will help.
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
0
 
LVL 10

Author Comment

by:Carnou
ID: 33485896
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
0
 
LVL 10

Author Comment

by:Carnou
ID: 33487128
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!
 
0
 
LVL 6

Expert Comment

by:r3nder
ID: 33487548
Great job Carmou!
0
 
LVL 6

Expert Comment

by:r3nder
ID: 33496756
Carnou
Thank you very much!, and it was my pleasure to help you in any way I could.
R3nder
0
 
LVL 6

Expert Comment

by:r3nder
ID: 33503436
they didnt assign the points though :( oh well thanks for everything. I am just glad you got your program running :)
0
 
LVL 10

Author Comment

by:Carnou
ID: 33503524
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.  *:-]
0
 
LVL 10

Author Comment

by:Carnou
ID: 33528917
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.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now