JSwiff
flash movies the java way
JSwiff Forum
  Search   Recent Topics     Member Listing    Back to home page 
Register / 
Login 
new method required  
Forum Index -> Bugs
Author Message
Jim



Joined: Aug 15, 2005
Messages: 34
Location: China
Offline

ActionBlock has a method named addAction, I think removeAction is also necessary.
And SWFDocument has a removeTag method is prefect.
Ralf



Joined: Jul 20, 2005
Messages: 127
Location: Germany
Offline

addAction is just a one-line convenience method, a wrapper for the add method of the List interface:
Code:
 public void addAction(Action action) {
   // add action to list
   actions.add(action);
 }

The problem with removeAction is: how do you identify the action you want to remove? That is, what argument do you want to pass to removeAction? A possibility would be to pass the index of the action (e.g. removeAction(0) would remove the first action within the block).
A simple solution is to use the getActions() method, which returns a list containing all actions of the block. If you want to remove e.g. the first action, just use getActions().remove(0). The same applies to SWFDocument (getTags().remove(0)).
I think removeAction(Action action) wouldn't make sense.
As the getActions() workaround is so easy, and adding an action is used much more often than removing one, I won't add a removeAction (and no removeTag) method for now - I hope you don't mind.
Jim



Joined: Aug 15, 2005
Messages: 34
Location: China
Offline

yes, I have read the source

maybe you can add a removeAction like this:

Code:
public void removeAction(Action action) {
    // remove action to list
    actions.remove(action);
  }


otherwise, the user should use anywhere like:
Code:
getActions().remove(action); 


just my view
Ralf



Joined: Jul 20, 2005
Messages: 127
Location: Germany
Offline

Ok, this really seems to be more important to you than I thought so I added two removeAction and two removeTag methods (wrappers for the remove methods of the list interface). Check the repository or the nightly build.
JobMatchNow1


Joined: May 1, 2008
Messages: 6
Offline

What does all this mean?
 
  Forum Index -> Bugs
Go to:   
Legal notes
Powered by JForum 2.1.4 © 2005 - Rafael Steil