ActionScript 3.0 :: Runtime Shared Library - Main And Assets SWF

Mar 26, 2009

This is the concept I want to get into code:
1) Have a Document Class attached to the Main.swf
2) Have a Assets.swf that has all MovieClips that set to Export and have been given actual Classes.
3) Have the document class Load the Assets.swf.
4) Once loaded, be able to create instances of the MovieClips from Assets.swf by writing the code in the Document Class of Main.swf

I can get all this to work.. However what I am finding is if I have a public function on the Document class that creates an instance of something from the Assets.swf, lets say var okTest:TestClass = new TestClass(); I have to also import it in the Document Class (import com.test.TestClass). When I compile it, yes it works. If I remove the Assets.swf file it doesn't display. Ok.. But I've noticed that the Main.swf file is including all the imported classes (eg: com.test.TestClass) so the Main.swf filesize is pretty much the same as the Assets.swf file.

I also ran it through a decompiler and can see yes in fact Main.swf is including all those Classes from Assets.swf because I'm trying to access them from Main.swf and had to import. So the biggest question is how do I go about this properly? Being able to load the asset file that has movieclips etc that have custom classes. Then create instances of those classes within the document class but only if Assets.swf is loaded.

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Shared Library - Loop Through To Get The Assets

Jan 8, 2011

I have a great shared library tutorial BUT I don't like one section. Assets.swf is the shared library with a variable array called availablegraphics on it's timeline where we put in the available assets That is the bit I don't like. Isn't there a better way to loop through to get the assets. Also they use a loop using library.availablegraphics - which I have never seen before and seems a little weird. In conclusion it's great but is there a better post or tutorial on shared library and how to loop through the assets without knowing exactly what or how many there are.

[Code]...

View 4 Replies

ActionScript 3.0 :: Modifying Library Assets At Runtime?

Feb 19, 2010

I'm building an avatar class that will allow a user to swap out character assets during runtime. The idea is pretty straight forward. The artist I am working with designed the art assets for the individual pieces of the avatar and performed the animations in flash. Since the animations were created in flash using vector art as opposed to pre-rendered 3d, I want to simply replace each individual movieclip within the animation with the asset selected by the player.

Problem:The issue i'm running into is that the animations have several key frames. My thought is to load the avatar object (an external swf) into my main application. Once loaded, I obtain a reference to all library assets that are used in the animations. For example, to get the face, I have something like:

Code:
if(this.loaderInfo.applicationDomain.hasDefinition("face"))
{

[code].....

View 4 Replies

Flash :: Set Up RSL (Runtime Shared Library)?

Feb 8, 2011

I'm having a little trouble setting up a new project (an e-Learning) that I think will benefit a lot from RSL.My case is something like this[code]...

The Main will be the first movie to be instantiated, then, all that is necessary from here will be download.Every lesson will be put in a fla/swf apart from the "Architecture" (that is the Main, Scenes, Navigation and a whole bundle of classes called Engine) and will be added at runtime inside the Scenes.

The Engine is responsible for handling repetitive and necessary tasks, events, common methods, communication with server, among other things.The Navigation is responsible for handling user input, as the navigation (next/prev lesson and such), and then passes it to the Engine, that will manipulate the Scenes (and it's children).

Well, I have some restrictions too:Every swf file that will be handed to our client need to have less than 80kb, which means I'm tied.I can't compile the whole thing as a package ready to delivery.As size counts, I need means to alleviate the load as much as possible.So, I searched a lot these days and found out RSL.I've created some tests to know better how to use this and, of course, got into a trap.

I haven't been able to set up my Flash correct, haven't any success with the "Library Path" (under AS3 configuration), haven't been able to compile classes inside the SWC...

Another thing is that I won't make the lessons, only the Architecture.Those lessons will be created by people that may not have any knowledge in AS3 (OOP or program logic) at all.And I'm not inclined to delivery the whole engine (source code) to anyone from outside that may mess with it, making the whole app (apps, in fact, we'll produce hundreds of e-learnings).

How to use RSL efficiently

How to bundle classes inside the SWC

How to package all that is imperative for the whole thing work in the SWC, and then, delivery only this SWC

View 1 Replies

Flex :: Use RSL(Runtime Shared Library) In It?

Dec 29, 2011

How to use RSL(Runtime shared library) in flex ?how can decrease loading time of swf using rsl?

View 1 Replies

Flash - How To Setup RSL (Runtime Shared Library)

May 24, 2010

I'm having a little trouble setting up a new project (an e-Learning) that I think will benefit a lot from RSL.
My case is something like this:

Main.fla - A Shell
Scenes.fla - I'll explain this in a minute
Navigation.fla - Some kind of GUI
Lots Of Fla Files - The Lessons

The Main will be the first movie to be instantiated, then, all that is necessary from here will be download.Every lesson will be put in a fla/swf apart from the "Architecture" (that is the Main, Scenes, Navigation and a whole bundle of classes called Engine) and will be added at runtime inside the Scenes.The Engine is responsible for handling repetitive and necessary tasks, events, common methods, communication with server, among other things.

The Navigation is responsible for handling user input, as the navigation (next/prev lesson and such), and then passes it to the Engine, that will manipulate the Scenes (and it's children).Well, I have some restrictions too:Every swf file that will be handed to our client need to have less than 80kb, which means I'm tied.I can't compile the whole thing as a package ready to delivery.As size counts, I need means to alleviate the load as much as possible.

how to use this and, of course, got into a trap.I haven't been able to set up my Flash correct, haven't any success with the "Library Path" (under AS3 configuration), haven't been able to compile classes inside the SWC...Another thing is that I won't make the lessons, only the Architecture.Those lessons will be created by people that may not have any knowledge in AS3 (OOP or program logic) at all.And I'm not inclined to delivery the whole engine (source code) to anyone from outside that may mess with it, making the whole app (apps, in fact, we'll produce hundreds of e-learnings).How to use RSL efficiently How to bundle classes inside the SWC How to package all that is imperative for the whole thing work in the SWC, and then, delivery only this SWC

View 2 Replies

Actionscript 3 :: What Is RSL (Runtime Shared Library) Used For In Flash

Oct 31, 2011

Kindly note I am not asking what SWCs are used for, I know about that. I want to know, the use of RSLs in flash. Say i have some useful classes which i currently am using by specifying the particular folder as an "Additional source folder". So, can i make use of RSL here. If not, when and why i need to use RSLs ( I use SWCs without any problem, but i wanna know how to make use of RSL, without making SWCs, ie just by bunch of actionscript classes )

View 1 Replies

ActionScript 3.0 :: Runtime Shared Library Woes?

Jan 12, 2009

I am facing an error using shared libraries. The error pops up during compile and only happen when I give an instance name to my imported asset. Let me describe further:

I have an asset library where all movie clips in this file are exported for runtime sharing - LibraryA.swf

Next is the file that uses the assets - ShirtA.swf

What I did is to import an asset from LibraryA.swf (e.g. collar) into ShirtA.swf. Now I have collar movieclip in my ShirtA library. I drag an instance of it to the stage and compile. No problems.

I then gave this instance a name, "myCollar". I tried to compile again, and I get an error from Flash IDE - 1046: Type was not found or was not a compile-time constant: collar

View 9 Replies

Professional :: Runtime Shared Library Preloading Error?

Sep 8, 2010

I just finished up my site, and this is the only thing holding me back from publishing it. Whenever I "Test" my site, I get this error: " Your content will not stream. Runtime Shared Library (RSL) preloading will require all of your content to download before the first frame will play.
 
To prevent this you can change the Runtime Shared Library Library Settings, in the Advanced ActionScript 3.0 Settings dialog which can be raised from the Publish Settings dialog.The Runtime Shared Libraries being preloaded are:
 
textlayout_1.0.0.595.swz for TLF Text"
 
Does anyone know how to correct this error? If you do, could you please walk me through it step-by-step. I am still very new to "Flash Professional (CS5)" & "ActionScript (3.0)"

View 4 Replies

Fonts - Cannot Get Flash Runtime Shared Library To Work

Oct 18, 2011

I am using Flash CS5 (assets) and FlashDevelop (code) for my project. We have about 20 fla/swf's that contain textfields. All of our textfields use the same Font, and the font is specific to our company so won't be installed on anyones computers, hence it needs to be embedded.

My ultimate goal is to have one single font embedded that all of the textfields use, for 2 main reasons:

Whenever we add more characters to the font (other languages), we only need to add them once and not 20 times The file size doesn't blow out dramatically

I'm having great difficulty in trying to achieve this. It seems that everything I try, characters are missing (only characters entered in the text property of the textfields in each fla seem to be embedded).

The latest solution I am trying is using Runtime Shared Libraries, as this seems like it should work. I have an fla called FNFont.fla. It contains just one object in the library, the embedded font. The font is exported to AS3, exported in frame 1 and exported for runtime sharing. The URL is FNFont.swf (all swf's are in the same folder).

In all the other fla's, I create the font object in font embedding. I tick Import for Runtime Sharing and give it the same class name as the one in FNFont.fla. The URL is FNFont.swf. The fla(s) contain many textfields using this font. The textfields have instances of themselves as children of other movieclips.

When I run the program and attempt to load a movieclip that contains an instance of one of these textfields, I get the error:

[Fault] exception, information=ReferenceError: Error #1065: Variable FontName is not defined.

FontName is the class name of the Font object in FNFont.fla and all other fla's. It is not the instance name of the textfield (nor the class name), so I don't understand how it thinks its a variable.

View 3 Replies

ActionScript 3.0 :: Runtime Shared Library Store Classes?

Sep 19, 2009

working a project that has 9 swf.a lot of the swf are using the same classes like papervison and tweenlite.is there a way to store classes like papervison in a share library?

View 1 Replies

ActionScript 3.0 :: Runtime Shared Library Load Timing?

Mar 22, 2010

I think I basically get runtime shared libraries, but I have some very specific questions which I have not been able to find answers for anywhere:

1) When you load swf "A" that references a runtime shared library swf, does the entire runtime shared library swf also immediately load? (true/false)

2) When swf "A" instantiates a symbol that is linked to be imported from the runtime shared library, does the entire runtime shared library swf load then? (true/false)

3) When swf "A" instantiates a symbol that is linked to be imported from the runtime shared library, does only that specific symbol load? (true/false)

My problem is, if I put all my bitmaps in swf "A", then it takes a really long time to load. I'm wondering, if I put all my bitmaps in a runtime shared library, and link the symbols in swf "A" to the runtime shared library, then will swf "A" load fast (because the runtime shared library is not loaded)? And when I instantiate a linked symbol, will it also load fast (because the entire runtime shared library is not loaded)?

View 5 Replies

ActionScript 3.0 :: Flash: Runtime Shared Library Preloading Warning?

Feb 22, 2011

I keep getting this warning coming up everytime I go to preview my file. Can anyone help me prevent this warning from coming up? I tried to create a seperate preloader for the website I'm making and that didn't work, and I think it might be because of this Runtime warning in my main file.

View 3 Replies

Professional :: Content Will Not Stream / Runtime Shared Library Settings

Mar 21, 2011

I recently began using CS5 with AS3.0 and I encountered this error.I can not find where I can edit the AS3.0 settings nor do I know what to change.

View 1 Replies

Actionscript :: Instantiate A Class From A Runtime Shared Library Through An Interface?

Dec 3, 2011

In my Runtime Shred Library SWF I have a class named BackButton that extends MovieClip and interfaces IGameButton:

package com.game.button
{
import com.interfaces.IGameButton;

[Code].....

View 1 Replies

Flex :: Build Error - Runtime-shared-library-path?

Jan 4, 2012

I recently switched a Flex project over to using RSLs. It built fine for quite a while but has recently dug its heels in and is giving me this error:configuration variable 'runtime-shared-library-path' requires a value for 'rsl-url'I went through all the flex XML files I could find and either this value doesn't exist or there are entries available for it. Nowhere did I see a <rs-url></rs-url> with no value.

View 1 Replies

IDE :: CS5 - Setting URLs For Import / Export For Runtime Shared Library

Aug 27, 2010

Summary: I don't quite understand how the import/export URLs for symbols in a runtime library work. I can't figure out how I can set them so that the runtime library will be properly loaded and accessible for other swfs to import from, if I want it to work both in a local environment (on my harddrive), and from a remote environment (on a web page).

Relative URLs seem to work great for the hard-drive case, but fail for the web page. Is there a magic way to set the relative URL to work from the web too? And/or, is there some way of manually loading up the RSL at runtime and making the importing swfs import from that loaded copy, rather than having Flash doing it behind the scenes based on the import URL set in the symbol? Following is a longish description of what I'm trying to do, and why... I'm trying to figure out if we can use RSLs to contain common UI controls for our next project. I'm running into an organizational issue that I can't quite figure out - how to get the RSLs to work in both a local development/debugging environment, and on a production web environment, with the same exporting/importing URLs.

Here's what my setup would look like. Say I have a main application main.swf, an RSL lib.swf, and a UI module dialog.swf. Main.swf loads or embeds dialog.swf. lib.swf exports some symbols that dialog.swf imports. On a local development environment, these swfs are found in folders like so:

[Code]...

View 1 Replies

Professional :: Setting Up Runtime Shared Library URLs With Multiple Environments

Aug 26, 2010

I'm trying to figure out if we can use RSLs to contain common UI controls for our next project.  I'm running into an organizational issue that I can't quite figure out - how to get the RSLs to work in both a local development/debugging environment, and on a production web environment, with the same exporting/importing URLs.
 
Here's what my setup would look like.  Say I have a main application main.swf, an RSL lib.swf, and a UI module dialog.swf.
 
Main.swf loads or embeds dialog.swf.  lib.swf exports some symbols that dialog.swf imports.
 
On a local development environment, these swfs are found in folders like so:

[URL]
 
Here is the problem.  If I set the export/import url for symbols in lib.swf to "assets/lib/lib.swf" (relative to the location of main.swf), the runtime library gets loaded fine in the local environment.  But in the web environment, it does not load - the player just shows the "..." graphic indicating it is trying to load. 
 
Alternatively, I can use "http:/myapp.com/assets/lib/lib.swf" as the export/import url.  Now, it will work in the web environment.  However, in the local environment, dialog.swf will load symbols from the lib.swf that is out on the web, not the one that is local.  But I need it to load from the local version, so that designers can muck about with the assets and see the results locally before publishing to the web.
 
Is there some alternative way to set up the swf's, or way to set the URLs, or some other hoop I can jump through that will make the RSL load properly in either environment without having to manually change URLs all the time?
 
(Details: I am using Flash Builder 4, CS 5, Action Script 3, Flash Player 10... No Flex!  My example omits some details from my actual setup, such as the fact that we are using a preloader to load the main application, and a php script on the web page to start the preloader.)

View 4 Replies

ActionScript 3.0 :: Get Component Assets To Appear In The Symbol Library Of Main Fla File?

Sep 16, 2010

I have built a component, but the assets do not appear in the symbol library of the destination fla when I drag the component to the stage. This is fine, except that I have embedded a font in the component. To ensure the font exists in the destination swf, it must exist in the symbol library of the destination fla.My component extends the UIComponent class, and I have a component shim, although I'm still not entirely sure of its functionI have followed all of the steps found in the 9 part MenuBar tutorial, and everything works, except for this one issue.

View 2 Replies

ActionScript 3.0 :: Change The "Runtime Shared Library"?

Mar 22, 2011

I recently began using CS5 with AS3.0 and I encountered this error -I can not find where I can edit the AS3.0 settings nor do I know what to change

View 1 Replies

ActionScript 2.0 :: Shared Assets And Linkage?

Aug 17, 2007

My company is working on an existing project done is AS2. Since this is a skinnable template, they would like to be able to have a choice of approx 20 fonts. Of course this would take a 1/2 hour to compile and be a 5mb download, so we need to load the fonts in dynamically.

So we have 20 compiled fonts, "arial.swf", "verdana.swf", etc And we have our root, "main.swf" At runtime, main.swf needs to load one of the font swf's and then be able to use that font.Here is the trouble: So far as I can tell, AS2 cannot give you access to the linkage ID of an asset you've loaded (using MovieClipLoader). I can place an individual instance on the stage, but I'd need to load the swf for each instance.

I tried creating a MC with a textfield in it and linked this to a class, but this doesn't work.I also tried to run duplicateMovieClip() on the instance that was loaded, but this doesn't allow you to relocate the clip to the desired location.

View 3 Replies

Professional :: One Parent.swf, Many Children, Lots Of Shared Assets?

Apr 16, 2011

I'm doing an AS2 project with a parent.swf that loads many child_##.swf's. they each use identical buttons and other library assets.tried using Shared Library concept two different ways:

1 - created library.swf and used assets from it for child swf's ... no problem when child is played by itself, but when parent loads the child's, shared assets do not work,

2- established parent.swf as the 'library', and followed the common steps of Shared Library setup, but shared assets did not work. of course, using class files works, but still I need a central place for the graphics ( I'm avoiding having my classes create graphics via draw methods ).

View 1 Replies

Professional :: Use A Shared Library - Recompile The Library Folder When Do The Smallest Changes To A Component?

Jul 20, 2010

I am working in two different applications, one to be compiled for desktop use (AIR) and one to be compiled for the web. They are part of the same project and use the same visual components, but they are completely different apps. When a visual component is changed in one application then it should also change in the other one. Is this a good situation to use a shared library fla? I am new to the concept of shared libraries and I am considering the options.

On one had I would not have to update 2 applications everytime I change something, on the other, I would always have to recompile the library folder when I do the smallest changes to a component.

View 4 Replies

Flex :: SWF Assets Loaded Into Flash SWF At Runtime Within Same ApplicationDomain

Dec 1, 2009

I'm trying to load a swf compiled by the Flex SDK into a swf exported by the Flash IDE and instantiate the assets by way of getDefinition(). Normally this works fine with assets exported from the Flash IDE then loaded into another swf also from Flash IDE.This is how I could normally do this using only the Flash IDE:Loader - > Using same ApplicationDomain - > getDefinition(class)Now, using the 'Test.as' compiled from Flex SDK using the [Embed] metadata tag:Loader - > Using same ApplicationDomain - > getDefinition("Test_" + class)The problem is I'd rather not have to keep track of the asset libraries loaded to prefix the class name I'd like to get (('Test_" + class) vs (class)). Is there any way of doing this without referencing the library the class is being pulled from or without accessing the original loader? This way I don't need to know which swf the asset is coming from, just the class name that I could instantiate from the current ApplicaitonDomain.

View 1 Replies

ActionScript 3.0 :: Switching From Embedding Assets To Loading At Runtime?

Mar 8, 2011

I have been handed a project that was built to embed all assets at compile time and I need to update the app to load assets from a remote server instead. Right now everything is being embedded as follows:

[Embed(source="assets/gfx/tutorialBg.png")]
public var tutorialBg:Class;
[Embed(source="assets/gfx/tutorialStraightArrow.png")]

[Code]....

These Class variables are being referenced all over the app to place the assets so I'm hoping to be able to update the code to load the assets and store them in these same Class variables. So far the methods I've tried have not worked. I've tried using URLLoader and it loads the images fine, but I'm not then able to extract the image and cast it as type Class to these variables.

View 0 Replies

Flex :: Swapping Movieclips With Other Assets At Runtime In A Flash Component

Sep 2, 2011

I have an animated character swc that is an empty skeleton basically (has all the body parts, animations, and functions/vars). I want to essentially put different clothes on that character at runtime so I don't have to have many copies of this character in my resources.

For example, I have 'skeleton' (the non-clothed model) and 'Bob', 'Jane', and 'Mary' characters. 'skeleton' is animated and fully works as an exported swc, and to get the other characters in their clothes/skins, I open up Flash CS5 and replace the movie clips with the 'clothed' versions of the components. To clarify,'skeleton' has "body parts" as movie clips that are all animated on the timeline, such as "head","face","left arm","right arm", etc. I open up 'Bob', who has the same exact design as 'skeleton', with the exception that 'Bob' has all the clothes and such as differently-designed movie clips. The size, shape, orientation, and reg points are all the same across all the components. After I've replaced all the movie clips in 'skeleton', I export it as a swc named 'Bob.swc' and I do this for all the characters.

What I'm asking is, how can I do this process ^, but at runtime instead, so I don't have all these duplicate root swcs ('skeleton' has a lot of frames on it) so I can cut down on a bunch of space? So I can do something like:

// bob gets all the actions and animations of skeleton
var bob:UIMovieClip = new skeleton()
// replace the body movieclip with a new looking one
bob.body = resources.bodyassets['bob']['body']

View 1 Replies

Actionscript 3 :: Runtime-loaded Assets Consume Memory/resources If They're Not Being Used?

Mar 12, 2012

I'm making a game for the browser that has a lot of assets, but not all of them are needed at once. I'm deciding whether to embed my assets at compile time or load them at run time. I'm not concerned about loading time -- only the performance of the game during run-time.

If I load these assets and store them into memory for eventual use later in the game, will they consume system resources just being latent in an AssetLoader? Will that affect performance?

If I embed these assets, will they consume system resources just being latent in the compiled SWF?

Is there a difference in performance between these 2 methods?

View 2 Replies

How To Get XML Library Assets Back Into New FLA

Dec 15, 2010

I started using Flash CS5. I spent many hours working on a .FLA file. Saving as I went and at one point Flash CS5 crashed during the save. The .fla file is now corrupt. The new .fla format is essentially a .zip file. So I was able to change the file name to *.zip and explore inside of it. The DOMDocument.xml file is corrupt and dead. The DOMDocument.xml is the timeline so all my placement and animation is gone. However, my LIBRARY folder is in tact and has all of my library items as *.xml files. How I can get those library items into another .fla file so I don't lose ALL my work? I've tried creating a new .fla file and dragging the LIBRARY folder into the new .fla, but my library items don't show up when I load the new .fla in the Flash CS5 IDE.

View 2 Replies

ActionScript 3.0 :: Sharing Library Assets Between 2 Or More Swf?

Feb 19, 2009

Since I can access the library assets from external class, I have a question :

1. Is it possible to use any of library assets of one movie into another? Let's say in my movie A, I have McA1 movieclip in the library. Is it possible to access/display/addChild McA1 in movie B?

2. If there's a case that Movie B is loaded into Movie A - does all the library from Movie B will be inherited into movie A - vice versa - so it makes them accessible?

3. If the answer of 1, and 2, is no and no, is there any work around to make any library asset accessible accross the board? Is this what so called runtime sharing? Do you have any resource that I can refer to?

View 5 Replies

IDE :: Import Swf, Use Linked Library Assets?

Sep 9, 2009

I have fla_A, and fla_B. fla_B contains a single MovieClip which contains a bunch of MovieClips that are all set to Export for ActionScript (NOT first frame, as this will need to be preloaded). I want to load fla_B into fla_A, and be able to instantiate the nested clips (inside fla_B) as if they were native to fla_A itself.

After loading the swf, I'm using:

[Code].....

Can I cast "e.currentTarget" as something useful like MovieClip (well, not MovieClip, 'cause that doesn't work), or something that will stick around from which I can dynamically load things?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved