SharedObject Problems…HELP!!!!!

  • sparty91
  • Born
  • Born
  • No Avatar
  • Joined: Mar 29, 2010
  • Posts: 1
  • Status: Offline

Post March 29th, 2010, 4:41 am

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post March 29th, 2010, 4:41 am

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post March 29th, 2010, 3:03 pm

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.  
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 31 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.