Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Desktop, Mobile and non-browser Environments > FlashLite / Portable Devices Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-19-2006, 10:00 AM   #1
can16358p
Registered User
 
Join Date: Dec 2005
Posts: 27
Question SharedObect flush fails (Flash Lite 2.0)

First of all I want to say I couldn't find a place to post this and I don't know if it's the right place to post it here, if it's wrong, please move it to the correct place.

I have a weird problem with SharedObjects in Flash Lite 2.0

I know that it works different from the one on PC, and I read articles about it and wrote my code.

Here's the code from the dice throwing game I've been working on, it should be right according to the articles on the Internet:

Code:
function save() {
	_root.so.data.luck = luck;
	_root.so.data.skill = skill;
	_root.so.data.cheat = cheat;
	_root.so.data.money = money;
	_root.so.data.bank = bank;
	_root.so.data.credits = credits;
	_root.so.flush();
}
function loadednow(so:SharedObject) {
	trace(so.getSize());
	if (so.data.created == "yes") {
		trace("a");
		_root.luck = so.data.luck;
		_root.skill = so.data.skill;
		_root.cheat = so.data.cheat;
		_root.money = so.data.money;
		_root.bank = so.data.bank;
		_root.credits = so.data.credits;
	} else {
		trace("b");
		so.data.created = "yes";
		_root.luck = Number(50);
		_root.skill = Number(50);
		_root.cheat = Number(50);
		_root.money = Number(1000);
		_root.bank = Number(1000);
		_root.credits = Number(0);
	}
	save();
}
SharedObject.addListener("the_gamble", loadednow);
var so:SharedObject = SharedObject.getLocal("the_gamble");
just at the beginning of loadednow, I see 0 in the output for "trace(so.getSize());". That's true, there's no actual file for the shared object, never. I also always get traced "b", never "a". Thought there may be a problem with save() function I've written and tried so.flush() in lots of places, still no change. Then, I've added a status handler (onStatus) for so and realized that it always returned false (Flush.Failed). Why can this be? No problem with FP8 and movies made for it, but this one won't work. Is there a problem with my code or settings or anything else? (no problem with settings about allocating space for the so's, as I said fp8 and so's work perfectly.)
can16358p is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash, JavaScript and the HTML DOM (dHTML) drZoode HTML and JavaScript 10 08-21-2008 07:59 PM
Flash Lite 1.1 Um Design FlashLite / Portable Devices Development 1 12-02-2005 04:57 AM
Slide show Fash 4 (Flash Lite) spl72 FlashLite / Portable Devices Development 0 08-25-2005 09:03 AM
Flash Encrypt 1.2 Released. SIntrix General Chat 14 04-21-2005 10:02 PM
[Q] Do we need those forums??? CyanBlue General Chat 59 07-27-2004 12:13 PM


All times are GMT. The time now is 11:14 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.