Variables in an object

how do you access a variable in an object? i have created a subclass of movieclip in but cant access variables in instances of that subclass by using instancename.variable

do you know what you have the visibility modifier as??

Are they private variables, or are they public?

_Michael

i have declared them using attachMovie(“name”, ‘asfd’ etc etc); in the same timeline as i am calling them so does that make them public?

ah… you are not subclassing :wink: just creating new instances of an existing movieclip. Can you post the code you are using for initializing and grabbing those variables?

_Michael

here is a link to the files
http://www.dcem.net/dcemprob.zip

i initialise the instances inside of a mc called ALL on the main timeline and inside of the actions layer of that mc.

I am also having trouble getting the collision detection working. I want it so that when one square is over another it moves to another location. This is because the squares are going to be buttons and i cant have buttons covering each other.

i am going crazy trying to figure out what i am doing wrong!

I am sorry but I don’t understand what is going on in your file, do you think you could isolate the problem, maybe even try to replicate it in another file. Chances are if you can do that you will be able to see the problem, or right when you show us, we will be able to. Take Care

_Michael

sorry if i wasnt very clear, this is all very new to me (im a designer you see haha). My understanding is:

i created a subclass in the Square.as file

i initialised an instance of that class with the lines:

attachMovie(“square”, ‘portfolio’, 100 {BText: ‘PORTFOLIO’… etc});

now these instances have a set of variables as such:

var BSize:Number;
var xMin:Number;
var xMax:Number;

so if i made one with the instance name ‘portfolio’ i was wondering how do i access the values of the variables in ‘portfolio’? wouldnt it normally be something like portfolio._x or whatever to get the _x coord of that instance? what if i wanted the value of the variable BSize? i thought it would be portfolio.BSize.