Shared Object
Could some one please tell me where a good tutorial is for shared objects i want to be able to specify the location not use a cookie! or just send me the script.
Many Thanks Michael
FlashKit > Flash Help > Flash MX
Posted on: 07-15-2002, 05:31 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Could A MovieClip Be Stored And Shared In A Remote Shared Object?
Let's say there are two clients connected via FMS,
and have a remote shared object SO.
When one client has a movieclip mc and sets,
SO.data["movie"] = mc;
is it possible for the other client to render
the content of mc, after SO synchronization,
by simply doing:
mc = SO.data["movie"]:
???
Shared Objects. How To Undo Shared Object
Hi guys,
Basicaly I created a simple login function by following the shared objects tutorial (http://www.kirupa.com/developer/mx/sharedobjects.htm).
I wanted a button placed on my wlecome screen allowing the user to go back to the creating screen of the shared objects.
So basically another shared object can be made.
Any Ideas?
Shared Object
Hi,
Has anyone used the Shared Object in Falsh MX. I tried it but nothing seems to be saved when I restart the movie. Shared Object should store information on the users local computer like a cookie. I'm using it to store text entries in an address book application, but when I go back to the app all my entries are gone. Is there any way to see if the Shared Oblect is working fine?
$ Will Pay For Shared Object Help $
I've created a standalone quiz that tallies and scores performance. I need to create a shared object element that tracks the users scores in a list box. So I can review the perfmance data. This quiz will go on a laptop and will taken between 100 and 300 times I suspect. The quiz can be viewed <a href="http://38.181.236.4/~chimes/quiz/quiz.html" >here</a> and I created a page where the list box would reside, which can be reached by pressing a hidden button in the top right corner of the quiz frame.
I'm on a 48 hour deadline and have other things to work on, and will try to complete it on my own, but would pay for help at this point, as I'm not familiar with .so stuff yet. If you're interested: chimes@subsystem.com
Thanks
Has Anybody Used The Shared Object?
Has anybody out there used the shared object yet?
We are using XML to track every activity carried out by the user in our movies and storing that in a database, but it all comes to nothing if the user refreshes the movie before we track!
I was thinking of creating the tracking XML inside the shared object so that it cannot get wiped and [potentially] the user could restart from the same place the next time they use the movie.
Anyone any thoughts on this? Anyone done anything similar and come across any problems?
Much appreciated,
Gaius
[BTW, what is that cow icon there for?]
MX Shared Object
Hi guys,
I'm looking at the new feature in MX, shared Objects..
previously I had been using fscommand"save" in an .exe mov.
so now I've converted to MX I gota change it to SObjects!
and I would like to know if anyone knows if I can assign a path to write the file..! .sol file! if you could help me with the syntax I would be very grateful.!
Nate!
Shared.object Or Something...
Hi I hope someone can help with this first step I am taking with the shared.object or something like that...
If I had a mc that could be dragged...
How could I enable the next time the flash movie is opened or accessed for the mc to still be in the position in which it was left.
There are no server technologies involved.
Thanx in advance
Shared Object
i posted this yesterday, and i am more confused about it today.
I have a drawing program. I want to save the drawings as their own swf files. in the simplest explination possible, how can i assign a button to save the drawing.
Shared Object
what is shared object?
How can i use single shared objects for two or more different swfs.
Var Name In Shared Object
Hi, I'm using MX.
I constantly have this problem:
The thing I need to refer to has a variable in it.
I want to save the items of an list so that it goes like sharedobject.data.item1.name = whatever, sharedobject.data.item2.name=another name.... saving all of the items in a list.
I read another thread in FlashKit where another user had the same problem and was answered: use something like _root[mcname]._x = #. This is my code so far:
for (i=0;i<=_parent.imagelist;i++)
{
so.data["pic"+i].name = _parent.imagelist.getItemAt([i].label)
trace(so.data["pic"+i].name)
}
I've also tried doing a simpler version of the above:
for (i=0;i<=5;i++)
{
so.data["pic"+i] = i
trace(so.data["pic"+i])
}
, but it keeps saying "undefined."
I'd appreciate any help, thanx.
Shared Object - Where Are They?
I'm using a shared object as a cookie on my site. But I cannot figure out where it is..... It's not in my browsers temp internet files.
Is there a way to make them go away after a time period or when the user clears their temp internet files?
Shared Object
I need to save the text you type in, in 20 text boxes.
Ok i have read through the tutorials and looked through the posts, but i didnt get how to do this. I did go through the tutorial on macromedia.com on shared objects and i managed to get it to work. But the problem is, i have 20 text boxes and i need it to remember the text from every one, not just one of the text boxes. I did make it work but it took 549 lines of coding. I was wondering, is there a way to use shared objects to make flash remember what the user typed it 20 different text boxes withought having to use 549 lines of code?
Shared Object
Hi all ,
Came accross this problem.
Seems , when I create a shared object in a movie , I can only recall that object in that same move.
What I want to do is , create a shared object in one move and retrieve it's data in another movie.
Is this possible , or am I missing something here?
Thank you for reading this
Regards ,
Frank Schrauwn
Shared Object HELP
Hi there, I can't seem to retreive the variable that stored in the data from another SWF by using SharedObject. Below is what I've been trying to do.
I got an A.swf and B.swf and each of them has 3 navigation buttons (button A, B and C). when I click on let say A button in A.swf, it will store the A button's variable to "buttonStatus" by using SharedObject so that this button will be hilighted as visited link.
When I close the A.swf and relaunch it again, I can see the A button is highlited (visited) but when i open B.swf, the A button is not hilighted there. I'm wondering whether it is possible to retrieve the variable that stored in "buttonStatus" from A.swf so that whatever that is highligted in A.swf will be highlited in B.swf as well.
Below is part of the script that I placed in the first frame of A.swf and B.swf
---------------------------------------------------------------------
buttonStatus_so = SharedObject.getLocal("buttonStatus");
button1_txt = buttonStatus_so.data.buttonNumber1;
//tell the buttons to go to the particular frame based on the retrieved data.
if (button1_txt==1){
hilite1_mc.gotoAndStop(2);
}else{
hilite1_mc.gotoAndStop(1);
}
---------------------------------------------------------------------anyone can help will be very much appreciated.
thanks!
Shared Object ?
hi,
I am trying to use the shared object to save the _x and _y positions of several attached MC's. The attached MC's have all been given a variable name and attached to a dynamically created MC called "world".
I need to loop through all of the MC's in _root.world to save their postions to the shared object. Here is what I have tried,.... when I trace so.flush.. it traces to true but the object postions are not saved.......
Code:
_global.initSo = function() {
_global.so = SharedObject.getLocal("marinaSave");
// if the SharedObject object created a new shared object
// then some values need to be initialized and the flush()
// method is called to make sure the object can be saved.
if (so.data.wab == undefined) {
_global.newSo = true;
for (wab in _root.world) {
so.data.wab = {x:wab._x,y:wab._y};
}
for (waw in world) {
so.data.waw = {x:waw._x,y:waw._y};
}
for (wad in world) {
so.data.wad = {x:wad._x,y:wad._y};
}
so.flush();
trace(so.flush());
}
};
// call the function
initSo();
Am I using the for... in method correctly to loop through the MC's in _root.world and save their values?
Thx
NTD
Shared Object Help
Hi,
I have a dynamically created "world" mc that I am attaching campsite MC's to. I am trying to save thier positions in the "world" MC with the shared object. I am new to useing the Shared Object but I understand how it works for one MC's properties. I am trying save multiple MC data to a Shared Object array. I am close but I cant seem to get it quite right. Right now,... the data is saved when you press a campsite.... I cant seem to get it to work if I pull that code out and place it elsewhere. I am using a var "newCS" to refer to each campsite and declaring it as a local variable. If I try to use it as a global variable,... I get SO = undefined. Here is a look at the code I have now......
Code:
// load shared object
_global.current = null;
_global.initSo = function() {
_global.so = SharedObject.getLocal("campgroundSave");
// if the SharedObject object created a new shared object
// then some values need to be initialized and the flush()
// method is called to make sure the object can be saved.
if (so.data.x == undefined) {
_global.newSo = true;
so.data.x = new Array();
so.data.y = new Array();
so.flush();
}
};
c = 0;
remove = false;
// set remove variable true or false
_root.selectremove.onPress = function() {
_root.checkbox.Play();
};
// start new code
// create campworld
createEmptyMovieClip("campWorld", 0);
_root.campsite.onPress = function() {
c = c+1;
campWorld.attachMovie("campsiteMC", "newCampsite"+c, 5000+c, {_x:_root.campWorld._xmouse, _y:_root.campWorld._ymouse});
var newCS = _root.campWorld["newCampsite"+c];
if (!newSo) {
newCS._x = so.data.x[c];
newCS._y = so.data.y[c];
_global.current = newCS;
} else {
so.data.x[c] = newCS._x;
so.data.y[c] = newCS._y;
}
newCS.index = c;
startDrag(newCS);
newCS._alpha = 50;
newCS.onPress = function() {
newCS.fire.Play();
if (_root.remove == true) {
newCS.removeMovieClip(this);
c = c-1;
} else {
startDrag(newCS);
newCS._alpha = 50;
}
newCS.onRelease = function() {
stopDrag();
newCS._alpha = 100;
_global.current = this;
so.data.x[this.index] = this._x;
so.data.y[this.index] = this._y;
so.flush();
trace(_global.newSo);
trace(SharedObject.getLocal("campgroundSave"));
trace("c count = "+c);
trace(newCS);
trace("newCS index "+newCS.index);
trace("newCS.x = "+newCS._x+" "+"newCS.y = "+newCS._y);
};
};
};
// move world
_root.onEnterFrame = function() {
if (Key.isDown(Key.LEFT)) {
_root.campWorld._x += 5;
} else if (Key.isDown(Key.RIGHT)) {
_root.campWorld._x -= 5;
} else if (Key.isDown(Key.UP)) {
_root.campWorld._y += 5;
} else if (Key.isDown(Key.DOWN)) {
_root.campWorld._y -= 5;
}
};
initSo();
trace outputs...
Code:
newSo = undefined
[object Object]
c count = 7
_level0.campWorld.newCampsite1
newCS index 1
newCS.x = 236 newCS.y = 188
How can I use data from the Shared Object to load when the "campWorld" is created? Any suggestions?
Thanks
NTD
Shared Object Help
Hi,
I have a dynamically created "world" mc that I am attaching campsite MC's to. I am trying to save thier positions in the "world" MC with the shared object. I am new to useing the Shared Object but I understand how it works for one MC's properties. I am trying save multiple MC data to a Shared Object array. I am close but I cant seem to get it quite right. Right now,... the data is saved when you press a campsite.... I cant seem to get it to work if I pull that code out and place it elsewhere. I am using a var "newCS" to refer to each campsite and declaring it as a local variable. If I try to use it as a global variable,... I get SO = undefined. Here is a look at the code I have now......
Code:
// load shared object
_global.current = null;
_global.initSo = function() {
_global.so = SharedObject.getLocal("campgroundSave");
// if the SharedObject object created a new shared object
// then some values need to be initialized and the flush()
// method is called to make sure the object can be saved.
if (so.data.x == undefined) {
_global.newSo = true;
so.data.x = new Array();
so.data.y = new Array();
so.flush();
}
};
c = 0;
remove = false;
// set remove variable true or false
_root.selectremove.onPress = function() {
_root.checkbox.Play();
};
// start new code
// create campworld
createEmptyMovieClip("campWorld", 0);
_root.campsite.onPress = function() {
c = c+1;
campWorld.attachMovie("campsiteMC", "newCampsite"+c, 5000+c, {_x:_root.campWorld._xmouse, _y:_root.campWorld._ymouse});
var newCS = _root.campWorld["newCampsite"+c];
if (!newSo) {
newCS._x = so.data.x[c];
newCS._y = so.data.y[c];
_global.current = newCS;
} else {
so.data.x[c] = newCS._x;
so.data.y[c] = newCS._y;
}
newCS.index = c;
startDrag(newCS);
newCS._alpha = 50;
newCS.onPress = function() {
newCS.fire.Play();
if (_root.remove == true) {
newCS.removeMovieClip(this);
c = c-1;
} else {
startDrag(newCS);
newCS._alpha = 50;
}
newCS.onRelease = function() {
stopDrag();
newCS._alpha = 100;
_global.current = this;
so.data.x[this.index] = this._x;
so.data.y[this.index] = this._y;
so.flush();
trace(_global.newSo);
trace(SharedObject.getLocal("campgroundSave"));
trace("c count = "+c);
trace(newCS);
trace("newCS index "+newCS.index);
trace("newCS.x = "+newCS._x+" "+"newCS.y = "+newCS._y);
};
};
};
// move world
_root.onEnterFrame = function() {
if (Key.isDown(Key.LEFT)) {
_root.campWorld._x += 5;
} else if (Key.isDown(Key.RIGHT)) {
_root.campWorld._x -= 5;
} else if (Key.isDown(Key.UP)) {
_root.campWorld._y += 5;
} else if (Key.isDown(Key.DOWN)) {
_root.campWorld._y -= 5;
}
};
initSo();
trace outputs...
Code:
newSo = undefined
[object Object]
c count = 7
_level0.campWorld.newCampsite1
newCS index 1
newCS.x = 236 newCS.y = 188
How can I use data from the Shared Object to load when the "campWorld" is created? Any suggestions?
Thanks
NTD
Shared Object
I learned that Flash can not write vaiables to a txt file for example.
Can a shared object do this function? and can anyone show me an example on how to load simple variables to a file using a shared object--thanks--Charl
Shared Object Help.
Does anyone know of any good websites for help on Shared Objects? OR if anyone would be able to explain to me basics of saving shared object files and reading them later.
Thanks,
~Bill
Shared Object Help
Basically I have a startup screen which will be displayed the first time user comes to site (in seperate html page on top off main html) or if they don't disabled show on startup checkbox.
I use shared local connection to save startup = "true" or "false" depending on the option they have chosen.
My main movie then reads this token and displays the startup screen if this is true.
So bascially I have two screens one which launches startup screen if token == undefined (user never been to site) or if they have selected true if they select false it doesnt show.
This works fine however when I open startup screen html by itself and set checkbox then open the main screen (indivually). My problem comes when the user opens it for first time the startup screen shows and they select don't show. The shared object seems not to be set with new value. There's like a problem with scope when they open todether both using the shared object.
I have used the localpath parameter which allows multiple swfs to gain access to a shared object.
Does anyone know why this would happen?
Shared Object
Hi,
how do i store the current size of a movie clip into a shared object?
cheers,
G
Help With Shared Object ...
hi !
Ok, I'm trying to make a php page which has a flash menu that loads others pages with an includes function.
the problem is the page is kind of "reloaded" each time a link is cliked and the flash menu bar restart from frame 1, so it doesn't remember the tag (see here )
I know I have to use the shared object thing, and I've check macromedia for that, and used that code
but it doesn't work...is what I'm trying to do the right thing ?
thanks.
PS.I've attached my fla.
Shared Object Help
I'm completly new to the shared object concept of flash..
I am looking for a way to save a shared object (flash cookie) under a user specified name..
as well as a number of user specified variables..
And to be able to save multiple shared objects with different names and different variables... and then to be able to call up any one of those shared objects to retrieve the stored variables...
how do I go about something like that?
Shared Object?
I have no idea how to do shared objects here is what i have. Any ideas/ suggestions??
code:
dev = SharedObject.getLocal("deviations", "/");
if(dev.data.devList == undefined){
dev.data.devList = "";
}
function saveData(){
dev = SharedObject.getLocal("deviations", "/");
dev.data.devList = calc; //calc is a var in diff function
dev.flush();
_root.feedback.text = "Data saved!";
getData();
}
function getData(){
dev = SharedObject.getLocal("deviations", "/");
if(dev.data.devList != undefined){
calc = dev.data.devList;
trace(calc);
}
_root.display = calculated;
}
Shared Object
hi guys,
making a movie type thing, its got an input text box and i want what is typed into the box by the user to be stored when the application is closed and opened back up.
ive tried using SharedObject but im a bit of a beginner and really struggling - could anyone help with the code?
please note that its not a web based application, it will be opened from a cd, and also that any help would be much appreciated!
many thanks
Sarah
Need Shared-Object Help.
I want to be able to let users choose a theme on my top banner and save it so they can see the same one everytime they return to my site.
Check out www.stangette.com . You will see a yellow car and girl. I want to let people change the car and girl.
Changing it is no problem. I can easily do that. But once its one that "frame" I would like to be able to let the viewer click "SAVE" in which a local shared object would be stored on their PC and next time they visit. The flash movie will first look to see what the shared-object says and place the correct "frame" for the viewer
Can someone help or at least direct me to a page that explains how?
Thank You
Shared Object Help
ok i need help !
i have made up a program where the user can save lotto results for up to the last 40 weeks i would like it so that they can compare the results for from 1 to the entire 40 weeks how would i do this
for example the can go to the frame and select wateva weeks they want to compare and the information will show up ! PLEASE HELP ME
Can Anyone Help Me Out - Shared Object
hi all,
i have built up a code, in which i can store the current animation loaded in a presentation in a list component, just similar to add to favorite one .
I am using the Local Shared Object one with the list component.
This is the code so far i developed
var so:SharedObject;
var fname:String;
addFav.onRelease = function()
{
so = SharedObject.getLocal("myMovie","/");
so.data.filePath = loader._url;
_root.myList.addItem(so.data.filePath);
_root.so.flush();
trace(so.flush());
}
var listListener:Object = new Object();
listListener.change = function(evt_obj:Object) {
fname = evt_obj.target.value;
loadMovie(fname,"loader");
}
myList.addEventListener("change", listListener);
everything works fine with this code.While clicking the add to fav button, the current animation running (url of the swf) is stored in the list component, and when i click it back it is playing.
But, when i close and re-open the file, i am not getting the stored names in the list component.
Even though i am using the flush method, why it is not showing.
Can anyone put up their knowledge in this code, so that i will complete this.
thanks in advance
cheers
saikiran
saisen76@hotmail.com
Shared Object
I have created this code so that it searchs a shared object or adds them
if the user is found and they have completed tasks in other swf files stars (MC) will be added to the screen.
how can i do this so that it stores the info to the correct user from other swf files and load in the stars to the correct area?
thanks once again to the folk in flashkit!!
Code:
var currentUserName:String = "";
var bExists:Boolean = false;
var myUsers:SharedObject = SharedObject.getLocal("myUsersNames", "/");
// We check if the shared object exists, if not we create the arrays that will store the data
if (myUsers.data.created == undefined) {
myUsers.data.firstnameSO = new Array();
myUsers.data.created = 1;
myUsers.flush();
}
// when the NEW button is pressed we create a new entry or find entry
newButton.onRelease = function()
{
// This is going to get set eitherway
this.firstnameField = firstnameField.text;
// Do this so later we I can say, ok we didnt find it so lets add it
var found:Boolean = false;
// No point trying to loop through it if it doesnt exist
if(myUsers.data.firstnameSO != undefined)
{
for(var i:Number = 0; i < myUsers.data.firstnameSO.length; i++)
{
if(myUsers.data.firstnameSO[i] == firstnameField.text)
{
found = true;
break;
}
}
}
else
{
// The array doesnt exist so create it
myUsers.data.firstnameSO = [];
}
if(!found)
{
myUsers.data.firstnameSO.push(firstnameField.text);
myUsers.flush();
}
_root.mountains.cave1.invisibleborder.enabled = true;
_root.mountains.cave2.invisibleborder.enabled = true;
_root.mountains.cave3.invisibleborder.enabled = true;
this.gotoAndStop(so.data.frame);
};
stop();
// the function below empty the fields on the right each time an item is removed from the list
function emptyFields(){
firstnameField.text = "";
}
for(item in myUsers.data){
bExists = true;
break;
}
if(bExists) {
trace("loaded shared object");
}
for (var prop in myUsers.data) {
trace(prop+": "+myUsers.data[prop]);
}
Shared Object Help
I'm creating a simple video rental program which needs data stored locally.
I wanted to know if anyone could put me on the right path to coding 3 input boxes which save the text/numeric data to a single shared object in a simple formatted manner.
Is this at all possible? To in the end be able to open the .swf file and have the shared object file be displayed in a scrolling window with all the entries?
Thank you in advance
[F8] Shared Object Between 2 Mc's
Hi Guys,
I am pretty new to shared objects and need some help.
I have two mc's, one is the login (php/flash) and the other is secured area. Basically when a customer accesses the secure area I want it to create a Shared Object for the login page to read.
Example:When the customer logs into the secure area and then goes back to the login page it will read the SharedObject telling it they already visited the secure area and go to frame 3 on the login page... bacially bypassing the login process again.
Below is the code I current have but it is not working... any help would be appreciated.
Secure area fram 1 fla:
Code:
var sos:SharedObject = new SharedObject();
sos.data.Play = "AA";
sos.flush();
Log in page:
Code:
var sos:SharedObject = new SharedObject();
if (sos.data.Play != "undefined") {
this.authmain.gotoAndStop(3);
sos.flush();
}
Shared Object ?
If I create a shared object like in the flash help files can I find this shared object?
ActionScript Code:
// create the shared object and set localpath to server root
var my_so:SharedObject = SharedObject.getLocal("savedText", "/");
Shared Object
hi, is it possible for 1 swf to set a shared object, then another on a different page collect it?
Shared Object
Hello, I have a form and I need to remember the first 6 items when a viewer revisits the form. Here's the start of my code:
ActionScript Code:
user = SharedObject.getLocal("user_profile");
if (user.data.name == undefined){
_root.gotoAndStop("Data Entry");
} else {
_root.form_mc.custname = user.data.custname;
custaddress = user.data.custaddress;
custcity = user.data.custcity;
custstate = user.data.custstate;
custzip = user.data.custzip;
custphone = user.data.custcity;
custfax = user.data.custfax;
custemail = usure.data.custemail;
_root.gotoAndStop("Data Entry");
}
then on my submit button, I have:
ActionScript Code:
submit_mc.onPress=function(){
user.data.custname = _root.form_mc.custname;
user.data.custaddress = custaddress;
user.data.custcity = custcity;
user.data.custstate = custstate;
user.data.custzip = custzip;
user.data.custphone = custphone;
user.data.custfax = custfax;
user.data.custemail = custemail;
user.flush();
}
But it doesn't work. Does anyone see an error in my code? I read the tutorial on this site and Kirupa's. I can't seem to figure this out.
thanks
Shared Object
No idea why its not working.
Just for a little flash movie here: http://www.thedownstream.co.uk/index.htm
Fla can be found here: http://www.thedownstream.co.uk/flash/OCS-Flash.fla
Code:
// create a Shared Object
var my_so:SharedObject = SharedObject.getLocal("OCS-Flash");
// if it's the first time here, i.e, played hasn't been set already,
// see the animation
if (my_so.data.played == undefined)
{
// set played to true
my_so.data.played = true;
my_so.flush(); // write the data
}
else
{
// you've already watched the animation before
// go to the last frame
gotoAndStop(_totalframes);
}
// for testing purpose, clear the Shared Object, i.e.,
// pretend you haven't watched the animation already
clearLSO_btn.onRelease = function()
{
my_so.clear();
};
play();
Shared Object
Hello,
How can I create shared object in the parent directory of the running domain?
Thanks and Regards,
Chandu
Shared Object
Can anyone tell me why I am getting Error #2134: Cannot create SharedObject. ? Also...any good tutorial on sharedObjects? Everyone I've tried online doesn't work right (I guess I'm not following the right steps or it is old). I just want to have a text field update when a variable changes and have it change for all the users automatically...can't figure it out for the life of me.
ActionScript Code:
var obj :Object = new Object();
var so :SharedObject;
var nc:NetConnection;
nc = new NetConnection();
nc.connect("rtmp://domain.com/oflaDemo");
nc.client = this;
obj["methodAlias"] = someFunc;
so = SharedObject.getRemote('oflaDemo', 'rtmp://domain.com/');
so.client = obj;
so.connect(nc) // nc is a reference to a NetConnection object, call this after setting the client
so.send( 'methodAlias' );
function someFunc():void
{
trace("hello");
}
Shared Object
I'm not having any luck getting shared object to work. I can getRemote..setProperty..can display the variable using data but when I flush() it says it cannot create the shared object. I am connected to the server..is there a way to test or see the results and why the shared object cannot create? I have read about sync but I cannot figure it out. Can someone tell me the steps I need to do..a simple do this then this...
I cannot get it to it will display in different swfs. I can set the data but when I try to communicate with the other swfs I don't have any luck.
Shared Object
Hi,
Does anyone know how the path of a shared object file is decided?
I have some.swf which loads someother.swf.
Depending on an unknown order of events or variable, sometimes the shared object gets written to:
C:Documents and SettingsuserApplication DataMacromediaFlash Player#SharedObjectssomesome.sol
and other times it gets written to:
C:Documents and SettingsuserApplication DataMacromediaFlash Player#SharedObjectssomeothersomeother.sol
I cannot find any documentation regarding the decision made or inner workings of how this path is decided by the Flash player.
Any help is massively appreciated.
Regards, snapple
Shared Object
the following code works fine and the shared object is retrieved and displayed ok.
mySharedObject_so = SharedObject.getLocal("myCookie");
saveButton_btn.onRelease = function() {
mySharedObject_so.data.myLoginData =
hiScore_txt.text;
mySharedObject_so.flush();
};
hiScoredisplay_txt.text = mySharedObject_so.data.myLoginData;
The question I have is where is the shared file on my computer - I can't find it. It is there somewhere as the code works fine and the data is retrieved ok. I cannot find a .sol file anywhere.
thanks - Steve
Shared Object Help
Hi,
On my web site i want to have a flash navigation bar that loads music when you first go to the site. But there is a movieclip with a button (two button states - on and off) in it that can turn the music on and off. This navigation bar appears on every page in my site. When a user clicks to turn the music off I want flash to remember that it is turned off when the user goes to another page. I have set up a script according to how I thought it should be after reading several different tutorials online and flash still turns the music back on when going to a new page. The music is kept in an external flash swf file and laoded into level 2.
Can someone take a look at the code here and tell me what's wrong?
Thanks!!
In the first frame of my movie:
music = SharedObject.getLocal("music1");
if (music.data.musicstate == undefined){
loadMovieNum("cellomusic.swf", 2);
} else {
musicstate = music.data.musicstate;
}
if (musicstate == yes){
loadMovieNum("cellomusic.swf", 2);
} else if (musicstate == no){
this.sound.gotoAndPlay("off");
}
There is a movieclip called "sound" that contains the sound buttons in an "on" and "off" state. The buttons have the following code...
In the "on" state the button has this code:
on (release) {
gotoAndPlay("off");
music.data.musicstate = no;
music.flush()
}
In the "off" state the button has this code telling it to load the music and go back to the "on" state:
on (release) {
loadMovieNum("cellomusic.swf", 2);
gotoAndStop("on");
music.data.musicstate = yes;
music.flush()
}
Shared Object... Almost There?
Oh, this shared object is very confusing....
I have this function:
Code:
function unlockponggame()
{
var checkforunlock:SharedObject = SharedObject.getLocal("checkforunlockkey", "/");
checkforunlock.data.snowpong = "true";
checkforunlock.flush();
var checkforunlock:SharedObject = SharedObject.getLocal("checkforunlockkey", "/");
var bExists:Boolean = false;
for(item in checkforunlock.data)
{
bExists = true;
break;
}
if(bExists)
{
trace("shared object loaded");
}
}
and it is called when player reach certain score points condition so the shared object is written to the hard disk.
I have this code in another frame to check if this shared object exists:
Code:
function unlockponggamebutton()
{
var checkforunlock:SharedObject = SharedObject.getLocal("checkforunlockkey", "/");
var bExists:Boolean = false;
for(item in checkforunlock.data)
{
bExists = true;
break;
}
if(bExists)
{
//then do this
}
}
when I search the hard disk for the sol file, I can´t find it but this last function is working, so I´m confused!!!
Can somebody tell me please if this logic is correct?
Thanks
Shared Object
I have a series of movie clips on the right side of the stage. I have a grid set up with a timeline for the user to drag the clips into the timeline. After all of the clips are arranged in order, I need the user to be able to press a play button and have all of the clips play in the order that they dragged them to the timeline. I have seen this done, but don't know how to make it happen. Here is a sample of my swf file. http://www.bigredrooster.com/ftp/loader5.swf
See my code attached. It allows the user to "save" the postion of the clips after they have arranged them.
Any direction or advice is appreciated. (Actionscript 2.0)
Thanks,
Rich
Attach Code
stop();
var btnAr:Array = new Array(lucy_mc, jd_mc, nike_mc);
var goto_ar:Array = new Array(2, 3);
var HotSpots:Array = new Array(hotspot1_mc, hotspot2_mc, hotspot3_mc, hotspot4_mc, hotspot5_mc, hotspot6_mc, hotspot7_mc, hotspot8_mc, hotspot9_mc, hotspot10_mc, hotspot11_mc, hotspot12_mc);
for (var i = 0; i<btnAr.length; i++) {
btnAr[i].onPress = function() {
startDrag(this);
};
btnAr[i].ivar = i;
btnAr[i].onRelease = function() {
var drag:Boolean = true;
stopDrag();
for (var j = 0; j<HotSpots.length; j++) {
if (this.hitTest(HotSpots[j])) {
if (drag) {
gotoAndStop([goto_ar[this.ivar]]);
this._x = HotSpots[j]._x;
this._y = HotSpots[j]._y;
}
}
}
};
}
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(32)) {
lucy_mc.play();
}
if (Key.isDown(16)) {
lucy_mc.stop();
}
};
Key.addListener(keyListener);
mySharedObject_so = SharedObject.getLocal("myCookie");
saveButton.onRelease = function() {
mySharedObject_so.data.myXlucyposition = lucy_mc._x;
mySharedObject_so.data.myYlucyposition = lucy_mc._y;
mySharedObject_so.flush();
mySharedObject_so.data.myXnikeposition = nike_mc._x;
mySharedObject_so.data.myYnikeposition = nike_mc._y;
mySharedObject_so.flush();
mySharedObject_so.data.myXjdposition = jd_mc._x;
mySharedObject_so.data.myYjdposition = jd_mc._y;
mySharedObject_so.flush();
};
loadButton.onRelease = function() {
lucy_mc._x = mySharedObject_so.data.myXlucyposition;
lucy_mc._y = mySharedObject_so.data.myYlucyposition;
nike_mc._x = mySharedObject_so.data.myXnikeposition;
nike_mc._y = mySharedObject_so.data.myYnikeposition;
jd_mc._x = mySharedObject_so.data.myXjdposition;
jd_mc._y = mySharedObject_so.data.myYjdposition;
};
PLEASE - Shared Object Help
Ok So im trying to eliminate the need to replay the flash header every time a link is accessed on the same page.
I know how to do it but here is my problem.
It works locally on my pc when I test the .swf movie. Once I upload it to my remote http site it doesent work. Plays once, then on refresh or site navigation it just gets stuck on "loading". I tried uploading to 2 different remote webservers with the same issue.
I tried 2 differnt flash movies with the same issue. Here are samples:
http://voice.xpservers.net/temp/header_v8.swf
http://voice.xpservers.net/temp/banner_v7.swf
If you press F5 for refresh it should take you directly to the end of the movie instead i get nothing.
My action script is as follows and it works locally.
I got from this tuturial: http://www.templatemonster.com/help/after_sale_support/Working_with_Flash/Advanced/article18.html
http://www.templatemonster.com/help/files/Flash/How_to_skip_a_flash_movie_(alternative).swf
var today = new Date();
var so:SharedObject = SharedObject.getLocal("time");
var period = 15000;
if (loaded == total)
{
if (!((_root.today-_root.so.data.val)<_root.period))
{
_root.so.data.val = _root.today;
_root.so.flush();
_root.gotoAndPlay(2); //full animation
}
else
{
_root.so.data.val = _root.today;
_root.par = "skip";
_root.gotoAndStop(162);
}
}
Shared Object
Scenario: On my stage are 4 movie clips (lucy, nike, jd, upfront). I also have 12 hotspots that I can drag the clips onto. The play button, when pressed, plays the movie clips in the order that I have placed them.
Problem: Once a clip is dropped onto a hotspot, it can't be moved to a new hotspot. Well, it can be moved, but the play order doesn't change to reflect the move.
Hopeful solution: I would like to be able to move the clips around the stage, drop them on hotspots and rearrange them, then when I have finally decided on a final resting place, be able to save the order so that when I press the play button, it will play the clips in that order.
Is something Shared object can do? Take a peek at my code and advise please. Thanks.
Attach Code
fscommand("fullscreen", true);
stop();
var btnAr:Array = new Array(lucy_mc, jd_mc, nike_mc, upfront_mc);
var MovAr:Array = new Array("lucy.swf", "jackd.swf", "nike.swf","upfront.swf");
var goto_ar:Array = new Array(2, 3, 4, 5);
var playAr:Array = new Array();
var HotSpots:Array = new Array(hotspot1_mc);
for (var i = 0; i<btnAr.length; i++) {
btnAr[i].onPress = function() {
startDrag(this);
};
btnAr[i].ivar = i;
btnAr[i].onRollOver = function(){
holder_mc.loadMovie([MovAr[this.ivar]]);
};
btnAr[i].onRollOut = function(){
holder_mc.unloadMovie();
};
btnAr[i].onRelease = function() {
var drag:Boolean = true;
stopDrag();
for (var j = 0; j<HotSpots.length; j++) {
if (this.hitTest(HotSpots[j])) {
if (drag) {
if(HotSpots.length == 1){
HotSpots.push(hotspot2_mc);
}
else if(HotSpots.length == 2){
HotSpots.push(hotspot3_mc);
}
else if(HotSpots.length == 3){
HotSpots.push(hotspot4_mc);
}
else if(HotSpots.length == 4){
HotSpots.push(hotspot5_mc);
}
else if(HotSpots.length == 5){
HotSpots.push(hotspot6_mc);
}
else if(HotSpots.length == 6){
HotSpots.push(hotspot7_mc);
}
else if(HotSpots.length == 7){
HotSpots.push(hotspot8_mc);
}
else if(HotSpots.length == 8){
HotSpots.push(hotspot9_mc);
}
else if(HotSpots.length == 9){
HotSpots.push(hotspot10_mc);
}
else if(HotSpots.length == 10){
HotSpots.push(hotspot11_mc);
}
else if(HotSpots.length == 11){
HotSpots.push(hotspot12_mc);
}
playAr.push([goto_ar[this.ivar]]);
this._x = HotSpots[j]._x;
this._y = HotSpots[j]._y;
}
}
}
};
play_btn.onRelease = function() {
_global.finished = false;
_global.finished2 = false;
_global.finished3 = false;
_global.finished4 = false;
_global.indeX = Number(0);
gotoAndPlay(playAr[0]);
trace(playAr);
wait = setInterval(waiting, 100);
function waiting() {
if(indeX > playAr.length){
clearInterval(wait);
gotoAndPlay(1);
};
if (finished) {
gotoAndStop(playAr[indeX++]);
if (_currentframe != 2) {
delete finished;
}
}
if (finished2) {
gotoAndStop(playAr[indeX++]);
if (_currentframe != 3) {
delete finished2;
}
}
if (finished3) {
gotoAndStop(playAr[indeX++]);
if (_currentframe != 4) {
delete finished3;
}
if (finished4) {
gotoAndStop(playAr[indeX++]);
if (_currentframe != 5) {
delete finished4;
}
}
}
};
}
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(32)) {
lucy_mc.play();
}
if (Key.isDown(16)) {
lucy_mc.stop();
}
if (Key.isDown(39)) {
holder_mc.play();
}
};
Key.addListener(keyListener);
load_btn.onRelease = function() {
loadMovie("lucy.swf", movie3_mc);
};
}
mySharedObject_so = SharedObject.getLocal("myCookie");
saveButton.onRelease = function() {
mySharedObject_so.data.myXmovie1position = lucy_mc._x;
mySharedObject_so.data.myYmovie1position = lucy_mc._y;
mySharedObject_so.flush();
mySharedObject_so.data.myXmovie2position = jd_mc._x;
mySharedObject_so.data.myYmovie2position = jd_mc._y;
mySharedObject_so.flush();
mySharedObject_so.data.myXmovie3position = nike_mc._x;
mySharedObject_so.data.myYmovie3position = nike_mc._y;
mySharedObject_so.flush();
mySharedObject_so.data.myXmovie4position = upfront_mc._x;
mySharedObject_so.data.myYmovie4position = upfront_mc._y;
mySharedObject_so.flush();
};
loadButton.onRelease = function() {
lucy_mc._x = mySharedObject_so.data.myXmovie1position;
lucy_mc._y = mySharedObject_so.data.myYmovie1position;
jd_mc._x = mySharedObject_so.data.myXmovie2position;
jd_mc._y = mySharedObject_so.data.myYmovie2position;
nike_mc._x = mySharedObject_so.data.myXmovie3position;
nike_mc._y = mySharedObject_so.data.myYmovie3position;
upfront_mc._x = mySharedObject_so.data.myXmovie4position;
upfront_mc._y = mySharedObject_so.data.myYmovie4position;
};
Shared Object. Please Help
I'm trying to put simple shared object in my email form. Can someone review my code to tell me where I'm going wrong? I don't think I'm far off, but I'm not have success with the shared object. Thanks.
stop();
var variables:URLVariables = new URLVariables();
var varSend:URLRequest = new URLRequest("sendmail.php");
var varLoader:URLLoader = new URLLoader;
var so:SharedObject = SharedObject.getLocal("myForm");
varSend.method = URLRequestMethod.POST;
varSend.data = variables;
submit_btn.addEventListener(MouseEvent.CLICK, completeForm);
close_btn.addEventListener(MouseEvent.CLICK, toClose);
varLoader.addEventListener(Event.COMPLETE, loadComplete);
addEventListener(Event.ENTER_FRAME, saveUserData);
addEventListener(Event.ENTER_FRAME, fillUserData);
function completeForm(event:MouseEvent):void
{
if (fullName_txt.text == "" || email_txt.text == "" || yourNote_txt.text == "")
{
feedback_txt.text = "Please complete entire note.";
} else {
variables.fullName = fullName_txt.text;
variables.email = email_txt.text;
variables.yourNote = yourNote_txt.text;
varLoader.load(varSend);
event.currentTarget.saveUserData();
gotoAndPlay(26);
removeEventListener(Event.ENTER_FRAME, saveUserData);
}
}
function loadComplete(event:Event):void
{
}
function toClose(event:MouseEvent):void
{
gotoAndPlay(27);
}
function fillUserData(event:Event):void
{
if (so.data["fullName"] != null)
{
fullName_txt.text = so.data["fullName"];
}
if (so.data["email"] != null)
{
email_txt.text = so.data["email"];
removeEventListener(Event.ENTER_FRAME, fillUserData);
}
}
function saveUserData(event:Event):void
{
so.data["fullName"] = fullName_txt.text;
so.data["email"] = email_txt.text;
so.flush();
}
Shared Object Help
Hi there, I'm trying to learn shared objects by attempting
a basic function. I would like to have an .sol file remeber
what buttons are clicked on by a user and assign an alpha
value for the buttons that have been clicked.
Here's what I have..
ActionScript Code:
user = SharedObject.getLocal("clicks");user.data.button1 = button1;user.flush();
for the buttons I was thinking maybe
ActionScript Code:
on(release, ){user.data.button1 = _root.button1._alpha=50 user.flush();}
Am I doing this right?
Shared Object
!--Does anyone know if it possible to save the local shared object(.sol) file at a desired location or to embed it within the flash movie?
2--Is it possible to create an image file at runtime from a flash projector file?
Thanks,
VJ
Shared Object
I am thinking of having a very complexe stat system on my site, and to do this you must be registered. One of the ways of saving data is using shared object, but what i need to know is, can the shared object be edited manually without flash? Were is it saved, what formate is it saved in, is it encrypted???
Thanks for your help
Dan
lol, getting carried away with the funny smileys
|