-
Trouble updating parameters between two classes
hey guys, great forum - very useful.
When using more than one class, i'm having troubles passing variables between them (ie updating paramets when they change). In a simple example (with only 1 variable) there are two classes - Fader and FaderEffect (in seperate files). the faderEffect class has a constructor in it which creates a new faderEffect
public FaderEffect(float volume){
volumeLevel = volume;
}
In the fader class, i have code which creates a new object:
FaderEffect fader = null; // setting it up
if (fader==null){
fader = new FaderEffect(volume);
}
Which is fine. In the fader class i also have code which automatically updates the volume parameter:
public void parameterUpdate(String paramname, Object value) {
if (paramname.equals("volume"))
volume = new Float((String) value).floatValue();
}
But the problem is that the volumeLevel variable in the faderEffect class doesn't get updated because it only gets updated when you create the new object... so how can i get the varaibles to update automatically? At the moment i have to re-create a new 'Fader' each time...
I hope someone can help, as this is the last piece of the puzzle! 
Thanks guys
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks