Page 1 of 1

getting the forground entity

Posted: 21 Jun 2010, 12:32
by rut1630
Hy,
I have foreground layer (2x2) edited with the openspace 2 editor, and
made of 4 different parts (movie clips)- all in swf name 'backgrounds.swf'. the background name as it edited in the editor is 'b1'.

my question- during runtime- how can i get the entity of at least one of
those moviclips - the forground is consist of.

I need it all in order to controll the alpha of the all foreground
layer dynamically.

Thanks

Posted: 23 Jun 2010, 08:59
by Bax
You can use the IOpenSpace.getForegroundParts method.

continue the issue

Posted: 23 Jun 2010, 10:39
by rut1630
Thanks,

I used it already, but it gives me as a result an object type 'Array2' that have only three properties: width, height, size
but no other reference to any display object the foreground can be consist of.

this is the code line that I wrote:

var a:Array2=os.getForegroundParts();


Please help me to understand what am I doing wrong.

Posted: 23 Jun 2010, 12:15
by Bax
Here you can find the Array2 API: http://www.smartfoxserver.com/temp/as3ds-docs/
You have to iterate on the collection and use the get method to retrieve each foreground part.

end of subject

Posted: 23 Jun 2010, 14:02
by rut1630
thank you very much,
I didn't know nothing about the 'Array2' data structure.