  | |  | sharedObject strangeness | sharedObject strangeness
2004-02-23 - By Jon Bennett
Back Hi,
I 'm try to get a localSharedObject to store urls so I can show each
visitor which links they 've already visited.
I had it working fine using intergers, but need it to work with strings
instead. I 'm creating and saving the data ok whilst the movie is open,
but if I close it and test-movie again and trace out the SO 's array,
instead of getting an array with strings I get a load of empty indexes
???
here 's some code:
Links.prototype.createGetSharedObj = function () {
//
// trace ( "-- ---- ---- ---- ---- ---- -- ");
// trace ( "Links.createSharedObj ");
this.visitedLinks_so = SharedObject.getLocal( "sixsixsix/visited " );
trace ( "this.visitedLinks_so: " + this.visitedLinks_so);
if (!this.visitedLinks_so.data.visitedLinks_arr) {
this.visitedLinks_so.data.visitedLinks_arr = new Array ();
} else {
trace ( "visitedLinks_arr: " +
this.visitedLinks_so.data.visitedLinks_arr);
}
};
Then if someone clicks on a link (and the link hasn 't been flagged ie
clicked already):
this.returnAddress.visitedLinks_so.data.visitedLinks_arr.push
(this.linkURL);
var success = this.returnAddress.visitedLinks_so.flush ();
trace ( "saving: " + success);
trace (this.returnAddress.visitedLinks_so.data.visitedLinks_arr);
Now these all work fine when for as long as the movie is open but when
I close and reopen (test-movie) the traces change from:
saving: true
http://www.bangingtunes.com/,http://www.tuneinn.com/
to:
this.visitedLinks_so: [object Object]
visitedLinks_arr: ,
and so on. Anyone know why I can only store intergers in my shared
object and not strings ??? The arr is being incremented each time so
I 'm a little stumped as to why this isn 't working :-\
Thanks,
Jon
jon bennett | jon@(protected)
new media creative
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
J b e n . n e t
91 Gloucester Rd, Trowbridge, Wilts, BA14 0AD
t: +44 (0) 1225 341039 w: http://www.jben.net/
iChat (AIM): jbendotnet
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:104983
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)
|
|
 |