Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8203067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:24:57+00:00 2026-06-07T07:24:57+00:00

I am trying to reference a shared object (one that saves data), but whenever

  • 0

I am trying to reference a shared object (one that saves data), but whenever I try to, I get a crash.

This code works fine:

var var1:Object = { value:1 };
var varRef:Object = var1;

if(var1.value == 1) {
    varRef.value = 50;
}

trace(varRef.value); // outputs 50;
trace(var1.value); // outputs 50;

But when I try to use shared objects, it doesn’t work.

import flash.net.SharedObject;
var iapso:SharedObject = SharedObject.getLocal("purchases");
var varRef:Object = iapso.data.testing;

varRef = 90
trace ("The shared value is " + iapso.data.testing);
trace ("This should mirror it" + varRef);

If you’re able to figure out the issue, please post a fixed version.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:24:59+00:00Added an answer on June 7, 2026 at 7:24 am

    You must come from a programming background where pointers can be dereferenced.

    In this case, varRef is not varRef = &iapso. Setting its value does not change the value of iapso.data.testing;

    Initially, you set varRef as a pointer to iapso.data.testing:

    var varRef:Object = iapso.data.testing;
    

    Then, you immediately change it to a constant value object literal 90:

    varRef = 90;
    

    This does not set the value of testing to 90 – this changes the value of varRef.

    You could set varRef to iapso.data, then set testing as in:

    var varRef:Object = iapso.data;
    varRef.testing = 90;
    

    Then, the following would produced expected results:

    trace(iapso.data.testing); // 90
    trace(varRef.testing); // 90
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the code from the class within which I am trying to reference
I'm trying to create a shared object (.so) that will make it so, by
In the below code, i am trying to reference an external .dll, which creates
Trying the ggplot2 examples in the online reference manual, and particularly in this page
I've got an object that handles in memory caching for my data access layer
I'm trying to ahange data sources of multiple SSRS Report with Powershell to one
I am trying to get an RMI activatable server to work - but no
I have a object structure like this: public class Entity { IList<Relationship> Relationships{get;set;} }
I'm trying to use some code that I wrote on another computer that splits
This is a follow-up to Dynamic Shared Library compilation with g++ . I'm trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.