Sharedobject Or Other Method
Hi all
Im creating a flash form that will be accessible from our website and the customer can fill the form out and save the information ready to return and update at a later date.
Where does the data get saved to on the harddrive.
i have created the save feature with "sharedobject.getLocal" but i'm wondering are there any problems that could show up later, such as the customer having cookies turned off or cookies getting deleted via a pc cleanup. I f that was the case th user would return to see all information being discarded.
I want to avoid these if possible so is this the best way to store information.
FlashKit > Flash Help > Flash ActionScript
Posted on: 09-14-2007, 07:07 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
[CS3] SharedObject Being Set In Swf A, Check SharedObject In Swf B
Hi guys,
I haven't done any real work with sharedObjects so forgive me if the answer is obvious.
I am setting a SharedObject in swf 'A' if and i want to check it is set in swf 'B'
Both swf's are in the same folder space.
I have been messing with it the past couple of days but i cant get it to read what is set in swf 'A'.
am i able to read in swf 'B' what was set in swf 'A'?
Thanks
SharedObject Being Set In Swf A, Check SharedObject In Swf B
Hi guys,
I haven't done any real work with sharedObjects so forgive me if the answer is obvious.
I am setting a SharedObject in swf 'A' if and i want to check it is set in swf 'B'
Both swf's are in the same folder space.
I have been messing with it the past couple of days but i cant get it to read what is set in swf 'A'.
i am able to read in swf 'B' what was set in swf 'A'?
Thanks
SharedObject Being Set In Swf A, Check SharedObject In Swf B
Hi guys,
I haven't done any real work with sharedObjects so forgive me if the answer is obvious.
I am setting a SharedObject in swf 'A' if and i want to check it is set in swf 'B'
Both swf's are in the same folder space.
I have been messing with it the past couple of days but i cant get it to read what is set in swf 'A'.
am i able to read in swf 'B' what was set in swf 'A'?
Thanks
SharedObject Being Set In Swf A, Check SharedObject In Swf B
Hi guys,
I haven't done any real work with sharedObjects so forgive me if the answer is obvious.
I am setting a SharedObject in swf 'A' if and i want to check it is set in swf 'B'
Both swf's are in the same folder space.
I have been messing with it the past couple of days but i cant get it to read what is set in swf 'A'.
am i able to read in swf 'B' what was set in swf 'A'?
Thanks
Function In A Method Return True To Method's Caller?
I think I probably don't know the correct terminology to ask this question, but here goes:
In this example, can anyone tell me how to have the setComplete event function within the main method return true to the caller of the method, instead of just to the listener?
PHP Code:
function loadAsset(target:MovieClip, asset:String, assetLoaderInfo:LoaderInfo): Boolean { var assetLoader:Loader = new Loader(); var assetURLRequest:URLRequest = new URLRequest(asset); assetLoader.contentLoaderInfo.addEventListener(Event.OPEN, setLoaderInfo); assetLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, setComplete); function setLoaderInfo(event:Event) { assetLoaderInfo = event.currentTarget; } function setComplete(event:Event) { target.addChild(assetLoader); return true; } assetLoader.load(assetURLRequest); }
Function In A Method Return True To Method's Caller?
I think I probably don't know the correct terminology to ask this question, but here goes:
In this example, can anyone tell me how to have the setComplete event function within the main method return true to the caller of the method, instead of just to the listener within the method?
Many thanks!
PHP Code:
function loadAsset(target:MovieClip, asset:String, assetLoaderInfo:LoaderInfo): Boolean
{
var assetLoader:Loader = new Loader();
var assetURLRequest:URLRequest = new URLRequest(asset);
assetLoader.contentLoaderInfo.addEventListener(Event.OPEN, setLoaderInfo);
assetLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, setComplete);
function setLoaderInfo(event:Event)
{
assetLoaderInfo = event.currentTarget;
}
function setComplete(event:Event)
{
target.addChild(assetLoader);
return true;
}
assetLoader.load(assetURLRequest);
}
[AS2 OOP] Calling A Method In A Method
Hi everyone
i'm not quite sure how to phrase my problem, so i'll examplify:
Code:
class A{
function A(){
trace("construct");
}
private function moo(){
trace("moo!");
}
private function cow(){
trace("start mooing");
moo();
}
}
this does what I expect it to: construct, start mooing, moo!
Code:
class A{
function A(){
trace("construct");
}
private function moo(){
trace("moo!");
}
private function cow(){
trace("start mooing");
_root.onEnterFrame = function(){
trace("moo!")
}
}
}
this also does what I expect it to: construct, start mooing, moo!, moo!, moo!, ...
Code:
class A{
function A(){
trace("construct");
}
private function moo(){
trace("moo!");
}
private function cow(){
trace("start mooing");
_root.onEnterFrame = function(){
moo();
}
}
}
yet this doesn't, I'd expect it to: construct, start mooing, moo!, moo!, moo!, ...
yet the moo! moo! moo! doesn't appear, as if moo() never gets called it all.
so what I'm I doing wrong?
SharedObject?
Okay, I was checking out a new developer tutorial on macromedia.com when the author says:
"Although we'll cover the basics of reading from and writing to a SharedObject, much more information is available under the SharedObject entry in the ActionScript Dictionary (Help > ActionScript Dictionary)."
I can't find an entry for sharedobject anywhere. What's more is that it's not listed in the actionscript windows within flash. The author laters gives an example of use:
"so = SharedObject.getLocal("myInfo");"
But still I can't seem to find any references to SharedObject OR getLocal.
Anyone want to give me a push in the right direction?
Skex
Different Use For SharedObject?
I have a Flash website with a map and users can create new icons on it on the fly (using attachMovie). Changes made by any users must be visible to all visitors. People had advised me to use SharedObject but...
For SharedObject, it seems that every users can only save and see their own changes because SharedObject is stored locally. Is there a way to only use one SharedObject stored in the server? Or another way to put it is can every user who visit my website use the same SharedObject?
Thanks!
Help With Sharedobject
Hi,
I am using sharedobject to store information of flash movies.
mydata = sharedobject.getlocal("database")
somevariable = mydata.data["somevariable"]
All these movies are separate swf that are part of a course.
I need to make a function that exports and imports data from all movies but I haven't figured out how to access info from a different movie, only from the movie currently loaded.
Is this possible? con variables be stored by a.swf and then accessed by b.swf?
Thanks for your help.
SharedObject
Hello,
I have a simple animation that I don't want played after a return visit. It's boggling my mind.
Code:
stop();
so = SharedObject.getlocal("testing", "/");
if (so.data.Visited) {
gotoAndPlay("end");
} else {
so.data.Visited = true;
so.flush();
play();
}
This works great locally testing movie, but does not work on the server. Am I missing something here? Any help would be greatly appreciated.
SharedObject - Where ?
I make a Flash Windows projector where I use a sharedobject to save the data of the user. I want the user be able to save (on a disket for example) the sharedobject file .sol. So I want to automatically show to the user the place where is this file, like:
CWindowsapplication datamacromediaflash player...
Is there a way to display this link ?
Thank's
Michel
SharedObject Help?
I'm trying to get a better understanding of sharedobjects. I understand its like a "cookie" but where is the information being stored on the persons computer?
Sharedobject
I am starting a sharedobject,
myLocalSO = sharedobject.getLocal("flashcookie16" );
How do i clear all the information?
There is flush(); does that save info or kill the cookie?
is there a kill sharedobject function? so you can keep the object but set everything in it to default or the begining.
Sharedobject
why does this script say my sharedobject (myLocalSO) is undefined?
I clearly set it as "flashcookie15"?
this is nuts.
stop();
myLocalSO = sharedobject.getLocal("flashcookie15" );
trace(myLocalSO.data.counter); //indefined????????
if (myLocalSO.data.counter > 1) {
numVisits.text = "You have been here " + myLocalSO.data.counter + " times."
gotoAndStop(4);
}else {
Play();
myLocalSO.data.counter = 1;
}
myLocalSO.data.counter++;
SharedObject
Where is the folder on the local machine stored.
if you test this through flash not through a browser.
thanks.
Help With SharedObject
I have script to check reminder.cfm for text and if found, start the movie. What I want is once a user has seen the movie that it would not play again until the next day?
I have been using SharedObject but I jest cant get it to work.
e.g.
I have a text field on the scene Dynamic Text ,Instance name:txtName
Script also in frame 1:
myOjbect = SharedObject.getLocal("test");
myObject.data.myName = "Mark";
myObject.flush();
myOjbect = SharedObject.getLocal("test");
txtName.text=data.myName
But when I "test movie" it return "undefined" in the text box.
Sharedobject
where is the file stored that the shared object creates?
SharedObject, How?
Hi, I am trying to use the SharedObject, but I do not obtain, he is following, I have this menu, and when I click in some item and to call the next page, it he has that to continue with the selected menu, I do not obtain to make this, it always comes back to the normal one, I tried to read in help of the flash, but I did not understand.
SharedObject Help
Trying to set up a shared object for storing a language choice variable. I thought the following code should save a test.sol file to my hard drive, but I can find no such file. The trace(myObject.data.language); returns undefined. Can some one tell me what I'm missing?
Code:
var langSel = "en";
var myObject:SharedObject = SharedObject.getLocal("test");
myObject.data.language = langSel;
trace(myObject.data.language);
trace(langSel);
ps - Can some one also please tell me, and I feel pretty stupid asking because it's probably right in front of my face, how do you post your code with actionscript formating (not PHP or CODE as I have used)?
SharedObject From Swf To Swf
happy new year!
I have two swf's in the same domain.
one writes a user's preferences, and the other should pick them up.
trouble is, the one that should pick them up, doesn't.
this code writes the SharedObject:
PHP Code:
user_details = SharedObject.getLocal('avdetails_djcobblers');
user_details.data._me = prefs;
user_details.flush();
and this code in a different swf from the same domain should pick it up, shouldn't it?
PHP Code:
user_details = SharedObject.getLocal('avdetails_djcobblers');
details = user_details.data._me;
trace( "user_details._me=" + details);
But it doesn't, the trace returns a blank. But I don't know why.
Maybe someone out there does, please?
SharedObject Help
Hi all,
I am currently working on a cd-rom presentation, where on autorun
load up i have an .exe that pops up that is a form that writes to the
users default email client (outlook...etc).
My question is .... Can i use some script, I have been reading up on
the sharedObject stuff, that will recognise that the end user has
played the CD-rom before and thus the CD-rom will skip launching the
form.exe and just go to the main presentation.
Any help, advice, or "luke your a fool for trying this!!!" would be
great.
cheers
luke
SharedObject
I have been reading a chapter about creating a SharedObject, and the author says, "When the SWF session ends...all the information under the data property of your shared object is automatically written to the shared object file ready to be retrieved usitng the getLocal() method..."
The example given is:
var myObject:SharedObject=SharedObject.getLocal("file_ name");
To save to the object you write:
myObject.data.userName=userName_txt.text;
I have followed the example verbatim, but notice that when I exit the .swf and re-open it, the information that I wanted to save did not save. The author mentions myObject.flush(); to "force" the object to be written, but I would like to have this happen upon exit rather than asking the user to click a button or the like. Am I missing something?
Thanks in advance -
Sharedobject
im using shared object to save some input text for each time i open a file - i need to use several shared objects in one file, how do i do this?
SharedObject?
How does sharedobject work?
let's say I want to remember the _currentframe of a movieclip on the press of a button, what code would I use?
SharedObject
Hi all,
I am trying to create a smarter nav swf for some asp.net pages. The navs are separate to the content, i.e., the whole page is not a swf just the navs and some other smaller things.
I thought i would use a SharedObject to store the current page so if the user clicks a nav link it would only getURL if this wasn't the current page.
But it appears the SharedObject doesn't persist data between requests. Is this correct?
If I click a nav link it redirects me to another .net page with the same swf in it, but the page.currentPage is always undefined.
Is there a way to do this using pure flash? otherwise i will have to utilise .net session data.
this is my code.
Code:
function GetPage(pageToLoad)
{
var page = SharedObject.getLocal("page_kookie");
//
if (page.currentPage == pageToLoad)
{
// do nothing, stay at this current page
return;
}
else // if (page.currentPage == undefined || page.currentPage != pageToLoad)
{
page.currentPage = pageToLoad;
getURL(pageToLoad);
}
}
thanks
g00fy
[F8] SharedObject (between 2 .swf)
ok i JUST started working with sharedObjects and i can get them to work just fine, but my knowldge of them is very small, i was hoping there was a way 1 "sharedobject" can be "shared" between 2 swf files. for example, in test_1.swf lets say every time you hit a button it adds 1 to "cash" and test_2.swf file has a button that subtracts 1 from "cash". both store "cash" in the sharedObject. is there a way both can use the same object.
[Edit] Ok after much reading, i now know ("test", "/") allows all .swf files in the same directory to share the object. HOWEVER, the 2 swfs wont be in the sam directory, what i am going to have is, one is going to be an .exe file (the projecter thing) this will store their "cash" then, when they long onto my site (which is all flash) the site needs to be able to read that SharedObject and display the ammount of cash they have.
SharedObject
I've been reading off this page:
http://www.adobe.com/support/flash/a...ionary648.html
and I'm trying to figure out how to use sharedObject to save a person's stats so when they come back they can continue where they left off.
The only problem is... i really dont understand this at all. Could someone please help me my leading me in the right direction. I cant figure out how to write a script for my game.
Thanks,
DC
Sharedobject
Howdy,
I am trying to make the SharedObject attribute "isunique" a variable i can load in from my embed code.
Essentially I have 10 videos, each on its own page, I want to autoPlay only to new visiters.
Here is the line from my embed code:
Code:
so.addVariable("cat", "photo");
With the above example and the code below for reference, I would like "playMovie.data.isunique" to be read by flash as "playMovie.data.photo". Is this possible?
Code:
var playMovie:SharedObject = SharedObject.getLocal("visited");
var category:String = this.loaderInfo.parameters.cat;
var isunique:String = category;
function readyHandler(event:VideoEvent):void
{
// Pause until the video can play till the end
thevideo.myFLVPlayback.pause();
pausenplay.gotoAndStop("play");
if(playMovie.data.isunique == null) {
thevideo.myFLVPlayback.playWhenEnoughDownloaded();
//textbox.text = playMovie.data.isunique;
playMovie.data.isunique = true;
playMovie.flush();
}
if (volumelevel.data.volumeset == true) {
thevideo.myFLVPlayback.volume = volumelevel.data.vol;
volume_mc.slider_mc.y = volumelevel.data.slidery;
}
else {
thevideo.myFLVPlayback.volume = .5;
}
}
thevideo.myFLVPlayback.addEventListener(VideoEvent.READY, readyHandler);
Thanks!
SharedObject Help
I need to create a game and i need to do out a high score chart for local use only. I know i should use SharedObject.getLocal to do it but i need to do the highscore with name of the person who is in the top score. Moreover, i think i should do it in array so that i can arrange them from largest to smallest score. To keep things short i will summarise what help i need.
1. How to save the score together with the name into the local system using SharedObject. Provide code if possible.
2. How do i arrange them from Highest to lowest highscore when i retrieve the score from the system
Code:
var soGameScore:SharedObject = SharedObject.getLocal(“GameData”);
soGameScore.data.highestScore = score;
soGameScore.flush();
Thanks
Regard,
Prism
SharedObject
Hi all,
I used SharedObject to save data.
Code:
so=SharedObject.getLocal("save")
if(!so.data.dataSave)trace(undefined)
else trace(defined)
so.data.dataSave=true
When i run this code in first time, output "undefined", but in the second, output still "undefined". I don't know how to get the "dataSave". Please, help!
// I not good in E
SharedObject
Hi,
I've created a file containing a SharedObject which saves a single bit of data and another SharedObject file which reads the data. It works perfectly well and as expected. However, when I upload to my server it refuses to work. Any ideas?
Thanks in advance
SharedObject
I'm getting an Unhandled AsyncErrorEvent when I click on my button to update the chat. What do I need to do? I have two text fields on the stage. The user types in chatInput and user sees the results in chatBox. I can see my results that I type locally but it does not send to all those looking at the swf.
ActionScript Code:
var nc:NetConnection;
var myRemoteSO:SharedObject;
nc = new NetConnection();
nc.connect("rtmp://domain.com/oflaDemo");
myRemoteSO = SharedObject.getRemote("mo", nc.uri, false);
nc.client = this;
myRemoteSO.connect(nc);
sendBtn.addEventListener(MouseEvent.CLICK, sendToChat);
function sendToChat(event:MouseEvent):void {
myRemoteSO.data.userInput = chatInput.text;
chatBox.text = chatInput.text;
myRemoteSO.send(myRemoteSO.data.userInput, chatInput.text);
}
SharedObject
I wanted to create a shareed object to keep track of a when an AIR app was installed and set an expiration date.
i was hoping to control where this sharedObject is created.. but it seems that flash will put it somewhere secret.. is it possible to change where the LSO is created? and where it is looked for?
ActionScript Code:
var firstRun:SharedObject = SharedObject.getLocal("/firstRun");
//firstRun.clear();
if(firstRun.data.userInfo==undefined){
trace("this is the first time you are here");
firstRun.data.userInfo="BAM!"
}else{
trace(firstRun.data.userInfo);
}
SharedObject - When Will It Die?
Hi. I was wondering if anyone knows of a way to set the expiration date of a SharedObject. Is there a default setting? Does it just stay there FOREVER?
Just wondering so I can run it past the legal dept.
Mims
SharedObject...
I'm noob and I need help in order to use sharedObject...
I'll create a website and I'd offer this service: I'll open a shared list, that is persistent on the server.
Whenever a client makes any changes to this shared object, the revised data is available to all clients that are currently connected to the object or who later connect to it.
Someone advises me to use Flash Comm Server but I don't Know it... so I need help!!!
SharedObject Bug?
I'm trying create a sharedObject that basically tells if a user has visited before. If he has visited then it forwards him to the end of the timeline.
If he hasn't visited then it just plays.
For some reason when flash determines that the visitor has visited before instead of properly initiating gotoAndStop(275); it stops about 30 frames into the animation... or sometimes just stays one the first frame but screws up soem of the movie clips.
Heres the code from frame 1.
ActionScript Code:
stop();
var shared = SharedObject.getLocal("test6");
if (shared.data.vStat == undefined) {
trace("undefined");
shared.data.vStat = "visited";
shared.flush();
play();
} else {
trace("defined");
gotoAndStop(275);
}
Is there any reason why this wouldn't work? Something to do with loading the sharedObject in or something?
SharedObject É¡žåˆ¥
Hi,
I have a photo(in jpg format) in my Flash exe file.And I want to save it in Harddisk for further use.
Can I use "SharedObject"? I know "SharedObject" can save data,but how about picture (in jpg format)?
Thanks!
SharedObject
Hi,
I have a problem with SharedObject(ActionScript 3.0)
All times a user creates object "Sprites" in its screen the SharedObject
instructs to communicate to all users this action and the same design is designed on the
screen of all that are such conexao.
One of the events that Sprite removes senário him.
For this,
container.removeChild( SpriteFilho );
The problem is that I can not do this on other users
They identify that there is the object Sprite
container.contains( SpriteFilho ) = true
But this code does not work
container.removeChild( SpriteFilho );
Can you help me?
Attach Code
container.removeChild( SpriteFilho );
SharedObject Help Pls
hi.
i am testing out the MX's SharedObject on my login page with the help of the kirupa tutorial.
ok on my first frame which is the login screen, i put
if (go == "true") {
getURL("mainmenu.html", "_self");
user = SharedObject.getLocal("user_profile");
user.data.name = LGlogin;
user.flush();
}
the 'go =="true"' means when the login is successful.
am i wrong? because the browser keep reloading the mainmenu.html when the login is successful.
pls help. thanx . becasue i need it to do a project. thanx in advance
SharedObject, How?
Hi, I am trying to use the SharedObject, but I do not obtain, he is following, I have this menu, and when I click in some item and to call the next page, it he has that to continue with the selected menu, I do not obtain to make this, it always comes back to the normal one, I tried to read in help of the flash, but I did not understand.
SharedObject?
I'm trying to get a flash movie to start playing from only a certain frame--IF that page has been visited before by the viewer. Does anyone have any ideas on how to accomplish that? Thanks
SharedObject, How?
Hi, I am trying to use the SharedObject, but I do not obtain, he is following, I have this menu, and when I click in some item and to call the next page, it he has that to continue with the selected menu, I do not obtain to make this, it always comes back to the normal one, I tried to read in help of the flash, but I did not understand.
SharedObject?
I'm trying to get a flash movie to start playing from only a certain frame--IF that page has been visited before by the viewer. Does anyone have any ideas on how to accomplish that? Thanks
SharedObject To DOM
I need to store stuff on the clients machine for an application that I am working on, and my data is larger than a standard cookie (or 20) will allow. What I was thinking about was using the sharedObject to store data for me. I need to know (1) how to add data to this sharedObject using PHP and MySQL, and (2) how to get the data back out of it and use it in a web page.
Hopefully this is possible, if not, it should be.
Dan
SharedObject
:(
Code:
//
// STORE LOCAL SCORE /////////////////////////////////
////////////////////////////////////////////////////////////////////
var so:SharedObject = SharedObject.getLocal("mySharedObjectCookie");
if (so.data["tYourCount"] != null) {
tYourCount.text = so.data["tYourCount"];
}
this.theButton.onRelease = function() {
so.data["tYourCount"] = tYourCount.text;
so.flush();
};
//
It won't work i can't figure it out why help!
It's doing my head in.
ps. Go finnland go finnland. Lordi for president for the world.
var bResponceGood:Boolean = undefined;
this.onMessageResponce = function():Void {
if (bResponceGood = true) {
trace(" Thank You! :) ");
break;
} else {
trace(" :( ");
}
};
he he.
.
SharedObject Question
Hey guys,
Using sharedObject to store data that will then be sent and stored externally at acertain time. This data can be added to at different times, so it's not just one piece of data, send, another piece of data, send...etc. So basically I need a way to add each new piece of data to a new line within the shredObject.
Now, at present I have easily worked out how to add along one line:
myObj.data.storedData = (myObj.data.storedData + newdataVariable);
This will add the new data to the end of the currently stored data.
What I need though is a way to add a line break after the current data and then the new data, so it creates a list of data rather than one single line.
Anyone know how to achieve this?
Thanks
Dave
SharedObject() Clarity?
am really trying to suss out the shared object, there are just one or two things I wonder if anyone on here can clarify that the manual/website/tuts haven't, well maybe they have but I didn't get it.
dog = SharedObject.getLocal("myinfo");
now what I don't understand is why one bothers with the "myinfo" bit, as nowhere else do you reference it.
ie if you want to access data you access it via the dog.data.name etc, so what is the reason in setting one up.
Also I have used the following script
dog = SharedObject.getLocal("myinfo");
cat = SharedObject.getLocal("myinfo");
Again I reference the info I set up via dog & cat, and they both worked fine, even though they were both called "my info"
I don't just get it. Hopefully someone can clarify...
|