getting the forground entity

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

Post Reply
rut1630
Posts: 80
Joined: 29 Jun 2009, 10:27
Location: Israel

getting the forground entity

Post 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
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

You can use the IOpenSpace.getForegroundParts method.
Paolo Bax
The SmartFoxServer Team
rut1630
Posts: 80
Joined: 29 Jun 2009, 10:27
Location: Israel

continue the issue

Post 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.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post 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.
Paolo Bax
The SmartFoxServer Team
rut1630
Posts: 80
Joined: 29 Jun 2009, 10:27
Location: Israel

end of subject

Post by rut1630 »

thank you very much,
I didn't know nothing about the 'Array2' data structure.
Post Reply