SharedObject Problems…HELP!!!!!

  • sparty91
  • Born
  • Born
  • sparty91
  • Posts: 1

Post 3+ Months Ago

Working in Flash CS3 Actionscript 3.

I have a flash doc. with a 6 scenes.
Each scene has an animation at the beginning but I only want the animation to play once as people with click around in it.
This is housed on an internal server so I am using shared Objects.

this is what I have:
ACTIONSCRIPT Code: [ Select ]
var my_so:SharedObject = SharedObject.getLocal("visited", "/");
if (my_so.data.newVisitor != undefined) {
    this.gotoAndPlay(1,"promoter");
} else {
    my_so.data.newVisitor = "no";
    this.gotoAndStop(220,"promoter");    
}
 
  1. var my_so:SharedObject = SharedObject.getLocal("visited", "/");
  2. if (my_so.data.newVisitor != undefined) {
  3.     this.gotoAndPlay(1,"promoter");
  4. } else {
  5.     my_so.data.newVisitor = "no";
  6.     this.gotoAndStop(220,"promoter");    
  7. }
  8.  

Promoter is the scene name.

The first scene will run fine but when I add it to others I get this error:
1151: A conflict exists with definition my_so in namespace internal.
Moderator Remark: added code tags
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

I think what's happening is that variables actually do exist across scenes and so the same variable code is fighting across scenes.

Try giving each shared object a unique name in each scene. It might also be having problems with your reference to SharedObject. How are you creating the SharedObject the first time?

ACTIONSCRIPT Code: [ Select ]
var my_so1:SharedObject = SharedObject.getLocal("visited", "/");
var my_so2:SharedObject = SharedObject.getLocal("visited", "/");
var my_so3:SharedObject = SharedObject.getLocal("visited", "/");
 
  1. var my_so1:SharedObject = SharedObject.getLocal("visited", "/");
  2. var my_so2:SharedObject = SharedObject.getLocal("visited", "/");
  3. var my_so3:SharedObject = SharedObject.getLocal("visited", "/");
  4.  

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.