----- Original Message ----- 
From: "dsds99" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, February 22, 2008 6:41 PM
Subject: [flexcoders] as3 global variables - no more


> Yes, using global variables was easy solution to referencing
> movieclips from anywhere.
>
> I'm trying to link up my play button to play the selected track in a
> listbox. The two components are in separate classes.
>
> one solution is that in my main class I pass a reference of the
> listbox to my playbutton.
>
> Are there alternative solutions to this...Better OOP practice.

I thin k you either have a class missing, or the wrong push button class.

The button gets pressed and should fire off an event. In your application 
there needs to be a class that responds to the pushbutton. That class is 
also aware of the list, so it can know the button is pressed then access the 
current item on the list and activate the playing.

A method of this application class can be called by the buttons click 
handler..

Paul 

Reply via email to