Flash CS shares library resources during runtime

Source: Internet
Author: User
Http://help.adobe.com/zh_CN/flash/cs/using/WSd60f23110762d6b883b18f10cb1fe1af6-7deea.html
Sharing library resources during runtime

Shared library resources allow the use of resources from other FLA files in a FLA file. This feature is useful in the following situations:

  • When multiple FLA files need to use the same image or other resources.

  • When designers and developers want to be able to edit the drawing and ActionScript code for a joint project in a separate FLA file.

Shared library resources work in the following ways:

  • For resources shared during runtime, the source document resources are linked to the target document in the form of external files. Resources are loaded to the target document during file playback (that is, during runtime. When creating a target document, source documents that contain shared resources do not need to be created on the local network. To make shared resources available to the target document at runtime, the source document must be published to the URL.

Tutorials and videos
  • Tutorial: Shared library at runtime tutorial (flash cs4, including part of the ActionScript 3.0, source: slekx.com)

Process resources shared during runtime

Two steps are required to use the shared library resources at runtime: first, the author of the source document defines the shared resource in the source document and enters the identifier string of the resource and the URL to be published in the source document.(HTTP or HTTPS only).

Then, the author of the target document defines a shared resource in the target document, and enters a string and URL of the same identifier as those shared resources in the source document. Alternatively, the target Document Author can drag the shared resources from the published source document to the target document library. The ActionScript version set in the "publish" setting must match the version in the source document.

In any of the above schemes, the source document must be published to the specified URL so that shared resources can be used by the target document.

Define runtime resource sharing in the source document

To define the shared attributes of resources in the source document and link the resource to the target document for access, use the "component attributes" dialog box or the "Link Attributes" dialog box.

  1. When opening the source document, select "window"> "library ":
  2. Perform one of the following operations:
    • On the "library" Panel, select a video clip, button, or graphical component, and then select "properties" from the "library panel" menu ". Click "advanced ".

    • Select a font element, sound, or bitmap, and select "Link" from the "database panel" menu ".

  3. For "Link", select "share export for RunTime" so that the resource can be linked to the target document.
  4. Enter an identifier for the component. Do not contain spaces. This is the name of the resource that flashprofessional identifies when linking to the target document. Note: Flash Professional also uses a link identifier to identify the video clip or button that is used as an object in ActionScript. See "use video editing" or "ActionScript 2.0" in learning to use Adobe Flash
    Use video clips in the developer guide.
  5. Enter the URL of the SWF file that will contain shared resources and click OK ".

    When publishing a SWF file, you must publish the SWF file to the specified URL so that shared resources can be used by the target document.

Share resources when linking to the target document

You can enter the URL of the shared resource or drag the resource to the target document to link to the shared resource.

Enter the identifier and URL to link the shared resource to the target document.
  1. In the target document, select "window"> "Database ".
  2. Perform one of the following operations:
    • On the "library" Panel, select a video clip, button, graphical component, bitmap, or sound, and then select "properties" from the "library panel" menu ". Click "advanced ".

    • Select a font component and select "Link" from the "database panel" menu ".

  3. To perform "Link", select "share import for RunTime" to link to the resources in the source document.
  4. Identifier of the input component, bitmap, or sound, which must be the same as the identifier used by the component in the source document. Do not contain spaces.
  5. Enter the URL of the SWF source file containing the shared resource, and click OK ".

Drag a shared resource to the target document
  1. In the target document, Perform one of the following operations:

    • Select "file"> "open ".

    • Select "file"> "import"> "open external library ".

  2. Select the source document and click open ".
  3. Drag shared resources from the source document "Database" panel to the "Database" Panel or stage in the target document.

Disable component sharing in the target document
  1. In the target document, select the link component from the library panel and Perform one of the following operations:

    • If the resource is a video clip, button, or graphical component, select "attribute" from the "database panel" menu ".

    • If the resource is a font component, select "Link" from the "database panel" menu ".

  2. Deselect "share import at runtime" and click "OK ".

Back to the top: Share library resources during creation

Sharing resources at creation has the following benefits:

  • Avoid using redundant copies of resources in multiple FLA files. For example, if you develop a FLA file for a Web browser, IOS, and Android, you can share resources between these three files.

  • When you edit shared resources in a FLA file, if you open other FLA files that use the resource and get the focus, the changes are reflected in these files.

In the creation process, you can share library resources in two ways:

  • You can use components in an external FLA file by linking components in another FLA file to components in an external FLA file.

  • (Cs5.5 only) share components between FLA files of the same flash project in the "project" panel. For information about how to use the project panel, see process flash projects.

You can share components in a single FLA file by linking to them as follows:

  • For shared resources during creation, you can use any available components in any other FLA file on the local network to update or replace any components in the FLA file being created.

  • Update the components in the target document when creating the document.

  • The element in the target document retains the original name and attributes, but its content is updated or replaced with the content of the selected component.

Use the project panel to share resources as follows (cs5.5 only ):

  • Create a project in the project panel and a FLA file in the project.

  • In the FLA file, you can select the share check box for each project on the "library" Panel to specify which components you want to share with other files.

  • Create a second FLA file in the project.

  • Copy a layer, frame, or project from the first FLA file on the stage and paste it to the second file.

  • Flash moves the Shared Library Project in the paste element to a separate file named authortimesharedassets. fla in the project folder.

The following resource types can be shared in projects:

Resource Type

Can it be shared by itself?

Can I share a video clip?

Video Clip Element

Yes

Yes

Graphical components

Yes

Yes

Button Element

Yes

Yes

Font Element

No

Yes

FLV video

No

Yes

Embedded Video

No

Yes

Sound (in any format)

No

Yes

Bitmap (any format)

No

Yes

Compile and edit (SWC)

No

Yes

Components (based on components)

Yes

Yes

Update or replace shared Components

You can use any other component in the FLA file accessible to your local network to update or replace the video clips, buttons, or graphical components in the document. The original names and attributes of the component are retained in the target film, but the content of the component is replaced by the content of the selected component. All resources used by the selected component will also be copied to the target document.

  1. When a document is opened, select a video clip, button, or graphical component in the "library" panel, and select "properties" from the "options" menu panel ".
  2. If the "Link" and "Source" areas of the "component properties" dialog box are not displayed, click "advanced ".
  3. To select a new FLA file, Click Browse ".
  4. Locate the FLA file that contains the component (used to update or replace the component selected in the library panel) and click open ".
  5. Locate a component and click OK ".
  6. Perform one of the following operations:
    • Cs5: Under "Source" in the "component properties" dialog box, select "always update before release" and click "OK ".

    • Cs5.5: In the "component properties" dialog box, under "shared during creation", select "Auto Update" and click "OK ".

Define shared resources in the project (cs5.5 only)

By sharing resources between FLA files in a project, you can edit resources in a file and see that these changes are reflected in other FLA files that use the resource.

  1. Create a flash project. See create a project.

  2. In the FLA file of the project, Perform one of the following operations for each library resource that you want to share with other FLA files in the project:

    • Open the "library" Panel and select the "Link" check box next to the Resource Name.

    • Select Resources in the "Database" Panel, select "properties" from the "options" menu panel, and click "share with project.

  3. On the timeline or stage, copy a layer, frame, or stage project that contains shared resources.

  4. In a single FLA file of the same project, paste layers, frames, or stage projects into a separate FLA file of the same project.

Videos and tutorials
  • Video: Flash Professional cs5.5-share resources between projects (, Paul trani, Adobe TV)

  • Tutorial: use shared resources and project panel to create a mobile Project (Yuki Shimizu, adobe.com)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.