Flex :: Sharing Code Between Swfs?

Jun 4, 2011

Lets say I have two swfs A and B, and at runtime, swf A loads swf B, and I wish to share code between them, to minimize file size and download times.If swf B has some code (say. com.blah.HelloWorld), I tell the compiler to have swf B's source in swf A's classpath, but only do a compile-time link and not actually compile com.blah.HelloWorld into swfThis works, and I have tried it, using a the -includes and -externs compiler options.However, My problem is that I wish to do this the other way. i.e. swf A and B (and potentially swf C) all need com.blah.HelloWorld, but I want com.blah.HelloWorld to be compiled into just swf A, have it as an external reference in swf B ( and potentially C as well.)I tried doing this using the externs and includes, but I get ReferenceErrors when I do this.

View 1 Replies


Similar Posts:


Sharing Code Between Flex And AIR?

Nov 17, 2010

As you know, we could build a RIA application based on flex. Also, we could build an desktop application based on AIR. I have a question, If we want to build web & desktop application simultaneously. Could we use the same codes to ship our production to web & desktop?

View 3 Replies

IDE :: Using Runtime Sharing Of Multiple SWFs?

Nov 1, 2011

I'm currently planning out the UI for a game with a complex UI system. I have done some runtime sharing tests using fonts that are setup for sharing in one fla, and I've setup the import in another. Both files are exported as swc files and are included in the flash develop project (the font is included completely). This worked fine.What I would like to do is have my UI loaded on-demand. I was planning to have a general UI elements library that contains elements setup for sharing (similar to the font), then have separate swfs that are loaded into the main swf when they are needed. These separate swfs would use elements from the shared library. I can get this to work exclusively in the IDE, or exclusively on the server, but not both (making development awkward).

The big stumbling block I'm hitting is to do with setting up the URL paths.I think that all of the runtime paths will be based on the running 'Main' swf location. So all import/export paths need to use paths that work from this root location.for example 'data/ui/top_ui.swf' might import objects from 'ui_elements.swf' (effectively 'data/ui/ui_elements.swf'). This import will function fine when testing from the IDE, but when running on the server, this will fail as it will try to load 'ui_elements.swf' from the root folder. Worse still, it will not fire an error (as it has found 'top_ui.swf' fine) but the load will never complete as it cannot find the runtime swf.

The reason for this folder structure is that we would really prefer to keep our assets in a folder that could in theory be re-located to another server (should the bandwidth usage dictate it). To put these ui swfs in their own folder then causes all the linkage to break in the Flash IDE making editing a kludge. Fix it in the IDE and it will no longer function on load.At the moment it looks like we will just have to export swc files and embed the lot in the main swf to keep this easy for code and art.

View 2 Replies

ActionScript 3.0 :: Sharing Shared Objects Between Swfs?

Sep 15, 2010

Anyway, Im currently making a flash game in a group as part of a university assignment. We have made several sections to this game in different swf files and need them to all be able to access the same sharedObject. Is this possible? At the moment, the two seperate swf's im using both have the same name for the object, so we assumed this would mean it would work between the two?

View 1 Replies

ActionScript 3.0 :: Sharing SharedObjects Between Multiple .swfs?

Jun 2, 2011

I have a project that I think may be more manageable if I break it up into multiple small .swf files rather than having a gargantuan mega .swf.Now, I know that I could use a root .swf and load data from the others, but I think that it'll be a lot easier to debug and update if I'm using separate self-contained .swfs, so this is the direction I'm currently investigating.

However, the .swfs won't really work unless I can have user-data persist between them, so I'm wondering if I can load a SharedObject saved by another .swf file? Are there any important caveats that I need to be aware of?In particular, can anyone give me sample code that would allow me to do this with both an online and offline copy of the files; i.e - if I run the same set of .swfs from haravikk.com, and locally, I want them to still be able to share data with one-another. In this case though I won't need to worry about sharing data between a local copy and [url]..., just so long as the files themselves can pass data within whatever domain they're loaded it should be fine.

View 4 Replies

Flex :: Share Code Between Swfs?

Sep 24, 2009

Lets say I have two swfs A and B, and at runtime, swf A loads swf B, and I wish to share code between them, to minimize file size and download times.

If swf B has some code (say. com.blah.HelloWorld), I tell the compiler to have swf B's source in swf A's classpath, but only do a compile-time link and not actually compile com.blah.HelloWorld into swf A

This works, and I have tried it, using a the -includes and -externs compiler options.

However, My problem is that I wish to do this the other way. i.e. swf A and B (and potentially swf C) all need com.blah.HelloWorld, but I want com.blah.HelloWorld to be compiled into just swf A, have it as an external reference in swf B ( and potentially C as well.)

I tried doing this using the externs and includes, but I get ReferenceErrors when I do this.

I want to do this without a having a separate rsl, so I can reduce the number of http requests.

View 3 Replies

ActionScript 3.0 :: Runtime Code Sharing?

Aug 18, 2009

I'm working on a project that uses a lot of "widgets" that are displayed in the main application. Many of these standalone swfs where the same code is incorporated several times ( for instance TweenLite ). I want to optimize this by removing this added code from each widget to reduce load time. I'm working on Flex Builder, but this is an actionscript/flash project. I'm not sure how I should do this

View 2 Replies

Flex :: Example Flex Zend AMF Sharing Web Services Between Components In ViewStack

Aug 10, 2011

I've been searching for the last couple days but can't seem to find a basic example of what I'm looking for. I'm developing a Flex 4.5 app and in it I have a viewstack of 2 components that use some of the same services. Currently the only way I can get the app to correctly use the web services is by defining 2 different web services that use the same PHP web service file. For example: I have an app, and within it I have a viewstack with tab navigation of 2 components: #1) retrieve a list of all Salary Employees, and #2) retrieve a list of all Contractors. Currently to get it working I am defining a UsersTableEmployees webservice within component #1 and a UsersTableContractors webservice within component #2, but they both point to the same PHP class, and only differ in the arugment value I pass to them. Ie, getUsers("employee") and getUsers ("contractors"). Of course this is not best practice.

Searching StackOverflow and Google gives me many results about ColdFusion and MVC (example What's the best way to share data between components in Flex?), but I'm still confused. Can anyone here point me to a basic example (even sample MVC) and source code of an app that uses Zend AMF and allows different components to call common web services?

View 1 Replies

Flex :: How To Add Screen Sharing To App

Aug 18, 2011

Are there any off the shelf components for adding a screen sharing feature to my app?I've built real time text chat for a group chat room - now I'd like to have a button where a user can share their screen with the other members of the chat. Basically, I'm looking for a way to add this feature as easily as possible:

[Code]...

View 2 Replies

Flex :: Mvc - Sharing Data Between Different Components

May 13, 2010

i have in my flex application various mxml components that all need to show stats based on the same data. how can i go about doing that? do i need some mvc framework like cairngrom or puremvc for that or can i do it without them?

View 4 Replies

Flex :: Sharing Logic Between The Browser And The Server?

Oct 19, 2009

I'm working on an app which will, like most apps, have a whole boat load of buisness logic, almost all of which will need to be executed both on the server and the Flash-based client And I'm trying to figure out the best (read: least complex) way to implement the rules engine.

These are the parameters of the problem:

The rules engine must both run in a web browser (ie, in Flash Player) and on the server. Duplicating the logic (eg, by writing a "server" version and a "client" version) would be an unacceptable risk. The input/output data is fairly complex, so serialization is a nontrivial problem. We are currently using AMF for all of our serialization needs, and using another protocol would add significant complexity So it should probably be avoided. It is infeasible to implement a "rules description language". Experimentation has shown that rules are sufficiently complex that any such language would need to be Turing complete Which would also add a significant amount of complexity. The rules engine will not need to make some, but not very many, service calls.

Currently, the best contenders are:

Writing the code in ActionScript, then running it on the server. In theory it's possible to start up an AVM instance, get it long-polling a gateway, then pass data back and forth that way But that seems less than ideal. Writing the code in haXe. I don't know anything about haXe's AMF support, so that could be a deal-breaker. Something involving Tamarin. Seems like a viable option, but I haven't done enough research to tell either way.

View 1 Replies

Flex :: Screen Sharing Software Creation Using As3?

May 27, 2010

I wish to do screen sharing application using as3 as the part of one project. how to get screen sharing video using as3.

View 2 Replies

Flex :: Sharing Variables Between MXML Components

May 29, 2010

I have several mxml components in an app, all of which need the same variable called genericX. I've included that variable in the main mxml and made it public
[Bindable] public var genericX:Number = 102;
But I still can't access it from other mxml components. If I try to do this for example, it doesn't recognize the variable.
<s:Button x="{genericX}" label="Click" />

View 5 Replies

Flex :: Flash Video Capture And Sharing?

Dec 7, 2011

Is there any way to capture and upload video from web cam? Video upload expectation is it much smiler to Facebook video upload from web cam.

View 1 Replies

ActionScript 3.0 :: Flex Sharing Project On Different Computers?

Apr 11, 2010

I'm currently keeping all my flex projects in a dropbox folder (though considering changing to alternative with multiple folder support) as I'm continuously working on different computers.

Since my AS libraries doesn't have the exact same path on the different machines, I have to change the path in the projects I like to work on every time I switch computer.

View 7 Replies

ActionScript 3.0 :: Optimize Code For 100 Swfs Or More?

Jan 13, 2011

How can I make this code smaller adding 100 swfs or more.

var seccion:String="home";
var loader:Loader = new Loader();
function loadSection():void {

[code]....

View 4 Replies

ActionScript 2.0 :: Transistions Between .swfs Code?

Apr 3, 2004

This is the code I am using for a transistion from a .swf file when you click the button "contact":

on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "contact";
container.loadMovie("contact.swf");
} else if (_root.currMovie != "contact") {
if (container._currentframe >= container.midframe) {

[Code]...

Alright this works fine but the problem is, when you click this button, it works, but then you click any other button and it brings up the contact swf file again. Is there any way I can fix or change this code so it will work?

View 14 Replies

Professional :: Load Multiple Swfs Using The Following Code?

Aug 28, 2011

In actions for Frame 1:
var myrequest:URLRequest=new URLRequest("A.swf"); var myloader:Loader=new Loader();myloader.load(myrequest);img1.addEventListener(MouseEvent.CLICK,

[code].....

View 7 Replies

Swfs To Load In One Html File But This Code Does Not Work?

Sep 1, 2009

I found this code to load a movie but naming the button myRequest or myLoader does not do anything?[code]....

View 21 Replies

ActionScript 3.0 :: Code To Track Widgets/SWFs Across The Internet?

Jul 21, 2009

Is there code to track your widgets/SWFs across the internet?I would like to know how many times a SWF is downloaded & in what country, ect...........

View 2 Replies

ActionScript 3.0 :: Add Code To Main.swf That Is Calling Swfs With Three Players Correct?

Nov 20, 2010

I need to use the unload and stop method.But my actionscript code calls individual swf files which contain 1 video player each. How would I add the unloadandstop methods into the existing actionscript?First question, add this code to the main.swf that is calling the swfs with thre players correct?So far I would I add a second set of event listeners for this function, like this?[code]

View 3 Replies

ActionScript 2.0 :: Animated Buttons, External Swfs, Frame Labels, Better Code?

Jul 13, 2004

I have three animated buttonMc's with code like this on them..

on (rollOver) {gotoAndPlay(2);
}
on (rollOut) {gotoAndPlay(8);
}
on (release) {gotoAndStop(16);
_root.mtClip.play();

[Code]...

Currently If I want to add five more buttons the code must be duplicated for each buttonMC and this seems really inefficient. This is the only way I have been able to make everything work though.

View 2 Replies

Flex :: Session Sharing Between BlazeDS Servlets And Http Servlets?

Apr 30, 2011

I'm developing a Flex application that employs BlazeDS with Tomcat on the backend. The Flex client authenticates through the ChannelSet which in turn creates an authenticated session on Tomcat. From then on, all of the client calls are authenticated transparently. However, I have a regular HttpServlet for uploading files, which does not get the session information from the BlazeDS servlets.

Is there a way that I can get the Principal object in the HttpServlet? I know that I can get the session ID from the BlazeDS servlet, pass it to the client, and then send that along with the upload request.

View 1 Replies

ActionScript 2.0 :: CS3 Buttons In Loaded Swfs Loading Other External Swfs Into The Main Timeline?

Sep 11, 2009

I have a main fla file which loads an external swf into an empty movieclip on the main timeline which works fine but I want a button in the external swf to load another external swf into another empty movie clip on the main timeline.eg. start.swf loads UKEIAMap.swf into (empty movie clip within start.swf) MapLoader_mc then a button havant_b within UKEIAMap.swf needs to load HavantProjectSheet.swf into (empty movie clip within start.swf) ProjectSheetLoader_mc without unloading UKEIAMap.swf

View 3 Replies

ActionScript 3.0 :: External Swfs Load - Remove The Swfs And Sound After A New Button Is Clicked

Nov 13, 2010

I am loading eight external swfs by way of eight buttons with actionscript to remove the swfs and sound after a new button is clicked. This works fine except that as soon as you get to the frame where the actionscript is all the swfs load at one time on top of each other. I don't want any to load until the button is clicked for the right one. MouseEvent listener works but only after all the swfs have loaded. How do I get the swfs to load only when the buttons are clicked. I can't figure out what I am doing wrong.

[Code]...

View 5 Replies

ActionScript 2.0 :: Access Local Swfs Using Remote Swfs?

Jan 5, 2010

Is it possible to access local swfs using a remote swf

View 1 Replies

ActionScript 3.0 :: Flex - Valid JavaScript Code That Is NOT Valid Code?

Mar 12, 2010

Most JavaScript code is also syntactically valid ActionScript 3.0 code. However, there are some exceptions which leads me to my question:

Which constructs/features in JavaScript are syntactically invalid in ActionScript 3.0? Please provide concrete examples of JavaScript code (basic JavaScript code without DOM API usage) that is NOT valid ActionScript 3.0 code.

View 6 Replies

Flex :: AS3 :: App That Makes / Exports SWFs

Jan 8, 2011

I want to make an app that allows the user to add their own content (pics, movie clips, songs) and then the app saves/exports the content as a SWF so that the users can use the exported swf wherever they like. Can this be done? What do I need to look into?

View 1 Replies

ActionScript 3.0 :: Sharing XML Between .as Files?

Apr 22, 2009

I am customizing Google Maps for Flash.I have an external .AS file for my document class and one .AS file that extends the look of the Google Maps popup window.I am importing the locations of many apartment buildings from an XML file. The XML is being read in the main .AS file.There are textfields I need to populate in the popup.AS file but I don't know how to get that XML information from the document class .AS file into the popup.AS file. I wouldn't think I need to run an XML loading function in the popup.AS file right? how I can get variables from one .AS file to another?

View 4 Replies

Flash8 Sharing Art Across Files?

Feb 16, 2010

How would I set it up so that I can share a single piece of art across multiple files? My goal is to arrange it so that I can edit the art in the original file and automatically update the art in all files linked to it when published?

For example, I'm working on a character animation where the character appears in many episodes and the episodes are split into many .fla files. If I needed to change the appearance of the character in all of the episodes which are spread across many .fla files, I would I have to do it manually?

View 3 Replies







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