ActionScript 2.0 :: How To Use Variables With SharedObjects

May 25, 2005

[URL]. Click options, and in the resulting panel you will notice that there is a bunch of different options you can turn on/off/change. How can I use these variables with sharedObjects so that anything the user saves will get saved for the next time they come to visit my site?

View 3 Replies


Similar Posts:


Unable To Sync SharedObjects

Nov 18, 2009

Ive tried converting the SharedObject tutorial [url...] provided by Adobe from AS2 to AS3. When one client moves the ball, the other client should be able to see the ball moving on another swf, and vice versa.The AS2 one worked fine with my flash media server 3.5 and wampp server on.  When I tried the AS3 one, the sharedObject cannot sync, even though the connection was successful and the sharedObject "position" was created in the server.[code]...

View 9 Replies

Actionscript :: Iterate Through Each Of SharedObjects?

Aug 14, 2009

Is it possible to execute a "foreach" through each of my SharedObjects?

Something like this . . .
_so = SharedObject.getLocal("test","/");
foreach (var item:Object in _so)
{
// print key name and value
}

View 1 Replies

ActionScript 2.0 :: Log In Form With SharedObjects

Jun 22, 2009

how to make a simple log in and registration form for my game let say the user downloads the game then he craeates an acc on his local PC and then uses it to play the game that is all i want so can anone make me a sample.fla to see how this type of log in form works?

View 1 Replies

ActionScript 3.0 :: Reading The Remote SharedObjects?

Aug 1, 2008

I'm having trouble reading a sharedObject. I know it's written to the server because I can open it with wordpad and read it and the proper values are there. However, mySO.data.visitDate is always null or the size is 0.

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="initApp()">
<mx:Script><![CDATA[
[Bindable]
public var welcomeMessage:String;

[code]...

View 3 Replies

Professional :: Deleteing All Local SharedObjects

Sep 15, 2010

is there any way to delete all shared object data for a domain?  We used generated names for our swfs and over time it has created enough to reach the 100kb limit for our domain, creating the user prompt.  AFAIK, I cannot access the path above catOrgan_3342.swf to clear the other dirs catOrgan_3341.swf catOrgan_3340.swf etc, nor is there a global clear, or a way of enumerating the subdirectories.
  
Application DataMacromediaFlash Player#SharedObjectsQBX3423www.fluffycats.comcatOrgan_3342.swf<m y files>

View 2 Replies

ActionScript 3 :: SharedObjects Don't Persist Across Different Swfs?

Oct 20, 2010

I am serving two different swfs that read and write to the same SharedObject variable. The SharedObject variable is a number, and each swf checks that number to make sure it isn't using the same number twice. It then stores the last number it selects. In this way both swfs should never use the same number twice, no matter which order they're loaded.

If I repeatedly load one of the swfs, the never-twice rotation works. However, when switching back and forth between swfs, sometimes the number is repeated. SharedObjects are supposed to be global to the Flash Player, so why would this happen?

View 2 Replies

ActionScript 2.0 :: Flash Cookies And SharedObjects?

May 6, 2003

So I did the tutorial about SharedObjects, and I created a login movie which works fine.

My questions are as follows: Can i use a shared object I created in one movie (call it "mycookie") in a separate movie on another page, similar to an HTML cookie? If so, what is the syntax?

I tried reusing the mycookie = SharedObject.getLocal("user_profile")and it didn't seem to work. =(

Also, I know that alternatively I can pass flash variables to the URL with the POST method, but I forget the syntax. Time is of the essence here (project due tomorrow) so I'd really like some help if somebody knows the answer..

View 2 Replies

ActionScript 2.0 :: Everything Dealing With SharedObjects In The First Frame ?

Jul 1, 2009

Everything dealing with sharedObjects in the first frame is this:

[AS]
var PlannerData:SharedObject = SharedObject.getLocal("PlannerData");
SubjectChoices = PlannerData.data.subjectChoices;
if (SubjectChoices == undefined) {[code]....

Going to the second frame from the first frame, the data is perfect. Going back to the first frame from the second, I'll trace the data many times throughout the code without an onEnterFrame, and it'll tell me that the Array is good...But when I trace the onEnterFrame, it shows the Array is [undefined, undefined, ...] like..undefined 17 times.

View 1 Replies

ActionScript 3.0 :: Store The Items In SharedObjects?

Oct 9, 2009

I am trying to make a little picture store for my website.I want to store the items in sharedObjects, so the next time people come to my site the selected pictures are there for them.I learned a little bit of sharedObjects and make it work for me with Strings but I can't make it work with and Array.

View 3 Replies

ActionScript 3.0 :: Can SharedObjects Store Custom Classes?

Jun 13, 2009

I have a an array of a custom class that I'm trying to store in a SharedObject.Storing is working fine, but when I recall the SO next compile it only returns an array of generic Objects instead of my custom class. This only happens with custom classes.Code excerpt below, this may be way too cut out, but it seems it's what I've narrowed the problem down too.[code]

View 2 Replies

ActionScript 3.0 :: Sharing SharedObjects Between Multiple .swfs?

Jun 2, 2011

I have a project that I think may be more manageable if I break it up into multiple small .swf files rather than having a gargantuan mega .swf.Now, I know that I could use a root .swf and load data from the others, but I think that it'll be a lot easier to debug and update if I'm using separate self-contained .swfs, so this is the direction I'm currently investigating.

However, the .swfs won't really work unless I can have user-data persist between them, so I'm wondering if I can load a SharedObject saved by another .swf file? Are there any important caveats that I need to be aware of?In particular, can anyone give me sample code that would allow me to do this with both an online and offline copy of the files; i.e - if I run the same set of .swfs from haravikk.com, and locally, I want them to still be able to share data with one-another. In this case though I won't need to worry about sharing data between a local copy and [url]..., just so long as the files themselves can pass data within whatever domain they're loaded it should be fine.

View 4 Replies

ActionScript 2.0 :: Use SharedObjects In Detecting FLV Movie In Flash?

Jan 27, 2011

There are 3 flv movie in my flash page. Is there a way to indicate in my flash page if the flv movie is already viewed on user's browser? I need to put a mark on the movie if one of them is already viewed? Am I to use Shared Object?

View 1 Replies

ActionScript 3.0 :: Using SharedObjects To Save Resume Data?

Sep 11, 2011

So, I'm creating a quiz, and I'm using shared objects to save their resume data. So far so good. MOST of the various things I put into myso.data work fine. But oddly, two bits of information, specifically a String and an Array of Strings come out as [object][Object] when they are reloaded later. Now, at first I thought that maybe they just weren't getting written correctly, so I thought to trace them out before and after I put them in the SO.

When I do trace(myso.data.sectionName) or even trace(myso.data.sectionNamesArray) the first time (i.e. immediately after they get written, but before closing the window) everything works as expected. But if I trace those same things out upon the reopening of the swf, those things become [object][Object] for the String, and an array of [object][Object]s for the Array. So I thought maybe it was Strings in general, but other pieces of information, also Strings or Arrays of Strings trace out fine before and after. It's just these two pieces.

View 2 Replies

ActionScript 3 :: Not Receiving OnSync Delete Events For SharedObjects In SWF

Feb 27, 2011

I have an application that uses Remote SharedObjects and I am seeing some strange behaviour. I am writing an ActionScript application in AS3 using Flash Builder and connecting to Wowza Media Server 2. My application is working just fine but I am now trying to write unit tests for it using FlexUnit. My unit tests involve creating multiple connections to the same remote SharedObject and making sure that I am getting updates correctly. Everything seems to be working well except that I am not getting any of the SyncEvent.SYNC events with an info.code of "delete".

When I run my applications independently in separate tabs or even separate swfs embedded in the same page it works fine. For some reason though it does not work when inside a unit test. I have also found that if I load the swfs using a Loader inside the same SWF then I get the same behaviour. It seems to me to be something strange about the way multiples of the same SharedObject behave within the same SWF. I have had to work around other strange behaviour in the unit tests such as oldValues not being set properly in the onSync events too.

View 1 Replies

ActionScript 2.0 :: Creating Class That Switch SharedObjects In Game?

Nov 27, 2010

I have been working on a game (Pokemon haha) since around the beginning of June. I just started experimenting with Classes today and I've run into some big problems (as expected). I have many SharedObjects in my game and I started the game when I barely understood any code. But I've worked on it a lot and learned so much. Right now, I'm trying to create Classes so that I can save time and be more efficient with my code. But... With my first major attempt, I failed.

This is what I want to do:
Create a Class that will switch a bunch of SharedObjects in my game. I don't need the switching part (because that worked before when the code wasn't in a class), just the creating the class part that involves SharedObjects.

This is basically what I have:
ActionScript Code:
import flash.net.SharedObject;
class GrassLife {
so = SharedObject.getLocal("so_file");
function Life() {
so.data.variable7 = so.data.variable2;
so.data.variable2 = so.data.variable1;
so.data.variable1 = so.data.variable7;
//The variables switch at this part
}}

View 1 Replies

ActionScript 2.0 :: Are SharedObjects Flushed Or Deleted When The Browser Is Closed

Oct 26, 2008

I've been working on something of late that will display text the first time the user views it, and the second time, say something different. I've accomplished this using haredObjects. However, it seems that the information (the shared object) isn't removed when the user leaves of closes the browser. I there a workaround for this?

View 2 Replies

Actionscript 3 :: Flex Using Sharedobjects To Store Information On Server - Crash

Aug 26, 2011

I am working on a flex project using sharedobjects to store information on my server. I am not 100% sure how to do this, so I was looking up tutorials and came across this bit of code:

[Code]...

But when it gets to the 3rd line, it crashes. I don't know how to use the debugger for flex sadly enough

View 1 Replies

Media Server :: Use SharedObjects To Manage Some State Between My Server And Clients?

Mar 29, 2010

I'm trying to use SharedObjects to manage some state between my server and clients, and am having a lot of trouble understanding the documentation and can't find any examples that work. Here is what I'm trying to do:

1. Create a shared object on my server in an application instance running on my FMS.

2. Allow clients to receive updates to the state of this shared objects.

1. Create a shared object on my server instance.

2. Set up the proper calbacks so that a client can receive updates to this object.

I suspect that the number of lines involved to accomplis this is < 10, but the examples I've found in the documentation produce compilation errors.

View 7 Replies

ActionScript 2.0 :: Sharedobjects - Always Get "undefined" In Place Of "cowboy" Or "cowgirl"?

Jul 5, 2004

I create and populate a sharedobject in A.swf, like this :

var myCookie = SharedObject.getLocal("user_profile");
if (myCookie.data.firstname == undefined) {
myCookie.data.firstname = "cowboy";[code].....

The problem is that I always get "undefined" in place of "cowboy" or "cowgirl".

View 4 Replies

ActionScript 2.0 :: Defining Variables - Unique To Load SWFs Instead Of Declaring All The Variables

Mar 21, 2012

I have an empty SWF that's sole purpose is to call loadMovieNum and start the project. Each loaded movie has a few variables defined within them - unique to those loaded SWFs. Instead of declaring all the variables in each SWF can I declare all of them in one place, in the first frame of the empty loader it all starts from? I'm thinking I can then declare a variable which each loaded movie can increment as needed for me.

View 2 Replies

ActionScript 3.0 :: Variables True/false Custom Variables Work In Flash?

Aug 20, 2008

How do variables true/false custom variables work in flash?

For example, what I want to do is create a simple true=false variable that I can call on an if statement later.

For example:

Code:
Var1 = true;
if (!Var1)
{

[Code]....

I noticed that neither the "Var1 = true;" part or the if(!Var1) part worked in flash.

View 4 Replies

ActionScript 3.0 :: Array Of Variables - Make A Bunch Of Variables From A For Loop

Feb 21, 2009

How can I make a bunch of variables from a for loop. for example for (var i=0; i<total; i++) {var bunch(i);}. that i make a bunch of variables named bunch1, bunch2, bunch3. I keep getting errors. I program and use so many different languages that I dont know if that can be done with AS3. my only other alternative i can think of is to create some sort of event dispatcher object array. but I dont know how to get them all to send events to one listener with there index number.

View 5 Replies

Actionscript 3 :: Changes To Array Of String Variables Doesn't Update The Variables Themselves

Jul 30, 2010

I have a list of strings that I add to an array, then attempt to set those values in a for-loop using data that I read in. The array gets updated, but the values the array contains do not. I also have an array of buttons that I update this same way that works great, but strings don't seem to work the same way. I have tried moving the string array to give it full scope, and still nothing...

public class test extends Sprite
{
// Declare a list of strings
protected var title0:String = undefined;

[Code]....

View 1 Replies

ActionScript 3.0 :: Load Data From Different Variables - The New Variables Come Back As Undefined?

Jun 15, 2010

I'm writing code that takes data from mysql that's processed by a PHP script. It's actually a bit bizarre, at least to me. Anyway, here's some basic AS3 code that's moving toward what I want to do:

var loader:URLLoader = new URLLoader();
var urlRequest:URLRequest=new URLRequest("receive.php");
urlRequest.method=URLRequestMethod.GET;[code]....

For some reason, the statement "trace(evt.target.data);" produces a whole pile of garbled text before the actual stuff that it's supposed to show Because of problem #1, I've had to include a throwaway variable at the beginning, otherwise the first variable I try to pass into AS3 comes back as undefined. This causes errors when I run my flash movie in the IDE, but when I run it from the browser it doesn't seem to have any effect.But this is the strangest thing of all whenever I make any changes to the database (and subsequently try to load data from different variables), the new variables come back as undefined. For example, let's say that I add another entry to the database, and decide to load students 2, 3, and 4 instead of 1, 2, and 3. When I do that, any new data I've added comes back as undefined, even though when I view the PHP output in my browser, it looks just fine.

And now for the REALLY bizarre part: I'll copy that output, paste it into my PHP script as an echo statement, comment everything else out, and my flash movie runs fine. Even though the output from the PHP script is exactly the same, it gives me errors.

View 9 Replies

ActionScript 3.0 :: Array Variables, Variables Not Working Correctly?

Jul 11, 2011

There is a bird, and you control its upwards movement with a key. It has thrust, gravity, it works fine. The problem is I have a bunch of icicles that come at the bird that he is supposed to avoid. I tried this first with math random to use as an x coordinate and than move across the screen, but the icicles had the same x-coordinates sometimes. I tried does not equal(!=) but that doesn't work. I made an array and each number that came out of the array I assigned a different variable. This works fine. I put this variable into the x-coordinate such as mc.x=((n)*60)+480. I did this for five different icicles. All their differnt variables have a different value, and I put them into the same function for each individual video clip, but they still don't go to the right coordinate. Here is the test code just for the initial coordinate of each icicle before it moves...////////////////////////////Quote:

var temp:Array = new Array()
for (var i:int=0;i<8;i++) {
temp.push(i);

[code]......

View 1 Replies

ActionScript 3.0 :: Create Several Variables To Aasign Each One Of Those Variables One Number?

Apr 9, 2011

i am trying to do a loop to create several variables to aasign each one of those variables one number.when i write

[Code]...

View 4 Replies

ActionScript 2.0 :: Check Variables In MyPictures.onLoad, The Variables Are Always The Same?

Aug 5, 2004

I have 2 loadVars - myVars, myPictures

basically i have defined their onLoad functions

so in myVars, i call for

Code:
myPictures.load("http://www.fakedevil.com/lurgee/pictures2.php?id="+this._parent.link2.text+"&time=" add getTimer(), "");

pictures2.php is working cos I just check so by rite the variables loaded should change.. but somehow each time I check those variables in myPictures.onLoad, the variables are always the same.

View 5 Replies

ActionScript 3.0 :: Load Variables, Remembering Variables

Nov 19, 2008

I am trying to load variables from a text file, and have them available from then onwards in the movie, globally so to speak.

While I can read the variable values in a loader function which executes when the text file is loaded, I don't seem to be able to keep those variables available afterwards.

View 10 Replies

ActionScript 3.0 :: Regular String Variables Vs XML Variables?

Jun 20, 2009

I'm trying to figure out which is more efficient in terms of memory and speed. What I'm doing is having a series of messages loaded to the screen. Is it just faster to write them in string variable or in an XML document which is more versatile in terms of editing and adding on to the document.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved