dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: using shared library????

Hybrid View

  1. #1
    Senior Member
    Join Date
    Jan 2002
    Posts
    161
    I am curious about how to implement a shared library. When a library object is needed, is the shared library called upon? Does the whole shared library have to load in for one object? Or do you have to initially load the shared library in using loadMovie so it can be used?
    any help appreciated.

  2. #2
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    the shared library can be used to pull an object from one library into the library of another, or onto the stage.
    if you have fla1 and want to use a object from fla4, just go to File>Open as Library. select fla4, the library of fla4 will open. drag onto the stage what you want.
    hope this helps

  3. #3
    Senior Member
    Join Date
    Jan 2002
    Posts
    161
    Thanks, but I don't think that answers my question. How do I implement an external shared library. Do I load it up at the beginning of my main movie, or does the shared library automatically get called when one of the items is needed?
    thanks

  4. #4
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    are you trying to load objects from one library within flash to another flash movie?

  5. #5
    Senior Member
    Join Date
    Jan 2002
    Posts
    161
    yea. I figure to save on file sizes. I'll keep all items that are reused throughout all my external.swfs, such as buttons and logos, in a library with these items located in the same directory as my main.swf . So my questions are the following:

    1)Do I have to load in that shared library when my main.swf loads?
    2)Will the shared library be loaded automatically when an item contained within is needed from an external.swf .
    3)When one item is called from the shared library does the whole library need to load? Or does the external.swf just go into the library and pull 1 item?

    Just want to understand how a shared library really works?

  6. #6
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    here is flash mx version on how to use a shared library and it's assets.
    -----------------
    Working with runtime shared assets

    Using runtime shared library assets involves two procedures: First, the author of the source movie defines a shared asset in the source movie, and enters an identifier string for the asset and a URL where the source movie will be posted.

    Second, the author of the destination movie defines a shared asset in the destination movie and enters an identifier string and URL identical to those used for the shared asset in the source movie. Alternatively, the destination movie author can drag the shared assets from the posted source movie into the destination movie library.

    In either scenario, the source movie must be posted to the specified URL in order for the shared assets to be available for the destination movie.


    Defining runtime shared assets in a source movie

    You use the Symbol Properties dialog box or the Linkage Properties dialog box to define sharing properties for an asset in a source movie, to make the asset accessible for linking to destination movies.


    To define a runtime shared asset in a source movie:

    1
    With the source movie open, choose Window > Library to display the Library panel.

    2
    Do one of the following:

    Select a movie clip, button, or graphic symbol in the Library panel and choose Properties from the Library options menu. Click the Advanced button to expand the Properties dialog box.

    Select a font symbol, sound, or bitmap and choose Linkage from the Library options menu.

    3
    For Linkage, select Export for Runtime Sharing to make the asset available for linking to the destination movie.

    4
    Enter an identifier for the symbol in the Identifier text field. Do not include spaces. This is the name Flash will use in identifying the asset when linking to the destination movie.

    Note: The Linkage Identifier is also used by Flash to identify a movie clip or button that is used as an object in ActionScript. See Working with Movie Clips and Buttons.

    5
    Enter the URL where the SWF file containing the shared asset will be posted.

    6
    Click OK.

    When you publish the movie, you must post the SWF file to the URL specified in step 5, so that the shared assets will be available to destination movies.




    Linking to runtime shared assets from a destination movie

    You use the Symbol Properties dialog box or the Linkage Properties dialog box to define sharing properties for an asset in a destination movie, to link the asset to a shared asset in a source movie. If the source movie is posted to a URL, you can also link a shared asset to a destination movie by dragging the asset from the source movie to the destination movie.

    You can turn off sharing for a shared asset in the destination movie, to embed the symbol in the destination movie.


    To link a shared asset to a destination movie by entering the identifier and URL:

    1
    In the destination movie, choose Window > Library to display the Library panel.

    2
    Do one of the following:

    Select a movie clip, button, or graphic symbol in the Library panel and choose Properties from the Library options menu. Click the Advanced button to expand the Properties dialog box.

    Select a font symbol and choose Linkage from the Library options menu.

    3
    For Linkage, select Import for Runtime Sharing to link to the asset in the source movie.

    4
    Enter an identifier for the symbol in the Identifier text field that is identical to the identifier used for the symbol in the source movie. Do not include spaces.

    5
    Enter the URL where the SWF source file containing the shared asset is posted.

    6
    Click OK.




    To link a shared asset to a destination movie by dragging:

    1
    In the destination movie, choose File > Open or Open as Library.

    2
    In the Open or Open as Library dialog box, select the source movie and click Open.

    3
    Drag the shared asset from the source movie Library panel into the Library panel or onto the Stage in the destination movie.




    To turn off linkage for a symbol in a destination movie:

    1
    In the destination movie, select the linked symbol in the Library panel and do one of the following:

    If the asset is a movie clip, button, or graphic symbol, choose Properties from the Library options menu.

    If the asset is a font symbol, choose Linkage from the Library options menu.

    2
    In the Symbol Properties dialog box or the Linkage Properties dialog box, deselect Import for Runtime Sharing.

    3
    Click OK.
    --------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center