|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.FSTransformObject
com.flagstone.transform.FSMovieObject
com.flagstone.transform.FSImport
public class FSImport
FSImport is used to import shapes and other objects from another Flash file.
Since the identifier for an object is only unique within a given Flash file, imported objects are referenced by a name assigned when the object is exported.
Attribute | Description |
---|---|
type | Identifies the data structure when it is encoded. Read-only. |
url | The URL of the file containing the object to be imported. The URL must be in the same sub-domain and relative to the URL of the Flash file containing the file importing the object. |
objects | A HashTable containing key-value pairs where the key is the identifier of the object being imported and the value is name assigned to the object when it was exported into a Flash file. |
To provide a degree of security the Flash Player will only import files that originate from the same domain as the file that it is currently playing. For example if the Flash file being shown was loaded from www.mydomain.com/flash.swf then the file contains the exported objects must reside somewhere at www.mydomain.com. This prevents a malicious Flash file from loading files from an unknown third party.
To export an object from a Flash file:
FSDefineShape shape = new FSDefineShape(...); movie.add(shape); movie.add(new FSExport(shape.getIdentifier(), "Shape"));
The object can then be imported:
movie.add(new FSImport("exportFile.swf", movie.newIdentifier(), "Shape"));
The FSImport class represents the ImportAssets data structure in the Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 5.
Field Summary |
---|
Constructor Summary | |
---|---|
FSImport(FSCoder coder)
Construct an FSImport object, initialising it with values decoded from an encoded object. |
|
FSImport(FSImport obj)
Constructs an FSImport object by copying values from an existing object. |
|
FSImport(java.lang.String aUrl,
int anIdentifier,
java.lang.String aString)
Constructs an FSImport object that imports an object from the specified file. |
Method Summary | |
---|---|
void |
add(int anIdentifier,
java.lang.String aString)
Adds the identifier and name to the list of objects to be imported. |
void |
appendDescription(java.lang.StringBuffer buffer,
int depth)
AppendDescription is used to present a string description of the object including all nested objects up to a specified depth. |
void |
decode(FSCoder coder)
|
void |
encode(FSCoder coder)
|
boolean |
equals(java.lang.Object anObject)
Returns true if anObject is equal to this one. |
java.util.Hashtable |
getObjects()
Gets the table of objects to be imported. |
java.lang.String |
getUrl()
Gets the URL of the file containing the object to be imported. |
int |
length(FSCoder coder)
|
void |
setObjects(java.util.Hashtable aTable)
Sets the table of objects to be imported. |
void |
setUrl(java.lang.String aString)
Sets the URL of the file containing the imported objects. |
Methods inherited from class com.flagstone.transform.FSMovieObject |
---|
getType |
Methods inherited from class com.flagstone.transform.FSTransformObject |
---|
clone, name, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FSImport(FSCoder coder)
coder
- an FSCoder containing the binary data.public FSImport(java.lang.String aUrl, int anIdentifier, java.lang.String aString)
aUrl
- the URL referencing the file to be imported.anIdentifier
- the identifier of the object to be exported.aString
- the name of the exported object to allow it to be referenced.public FSImport(FSImport obj)
obj
- an FSImport object.Method Detail |
---|
public void add(int anIdentifier, java.lang.String aString)
anIdentifier
- the identifier of the object to be imported.aString
- the name of the imported object to allow it to be referenced.public java.lang.String getUrl()
public java.util.Hashtable getObjects()
public void setUrl(java.lang.String aString)
aString
- a URL relative to the URL of the file containing the FSImport
object.public void setObjects(java.util.Hashtable aTable)
aTable
- the table of objects being imported.public boolean equals(java.lang.Object anObject)
FSMovieObject
equals
in class FSMovieObject
public void appendDescription(java.lang.StringBuffer buffer, int depth)
FSTransformObject
appendDescription
in class FSMovieObject
buffer
- a StringBuffer to which the description of each object is
appended.depth
- the maximum level of nesting up to which objects will be
displayed.public int length(FSCoder coder)
length
in class FSMovieObject
public void encode(FSCoder coder)
encode
in class FSMovieObject
public void decode(FSCoder coder)
decode
in class FSMovieObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |