ActionScript 2.0 :: Static Classes Shared Across Multiple SWF's?

Apr 11, 2009

How do Static classes work in projects where child swf's use the same Static class as their parent?

For simplicity... lets say we have some older content swf files that are using TweenLite version 8 ( a common enough Static class.) But the parent SWF is being updated and uses a more recent version of TweenLite (version 10). The child SWF's are loaded into the parent SWF. Do the child SWF exist in there own sandbox and have TweenLite version 8 running and the Parent runs it's own copy of TweenLite 10? Or does the parents clips Static class of TweenLite (version 10) overwrite the children Static class using some sort of magical shared memory space when JIT (runtime) compiling?

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Static Classes And Static Methods?

Feb 21, 2007

Yesterday I found myself wondering, what is the difference between either having a class with methods that are all static, or simply giving your class the static attribute?

View 9 Replies

Actionscript 3 :: Central Event Dispatcher Shared Between Instances (not Static)?

Aug 22, 2011

I'm building a flash app (just AS3 with FlashDevelop) and I'm having some trouble keeping things loosely coupled around the event system. I've done a lot of reading about central event systems and static eventdispatchers but they don't quite fit the bill for me. What I'm building is similar to a video player.I have a Player class which is the parent of all the other little parts of the app.The Player class extends Sprite and I've currently designed it so that you could instantiate multiple Player's and put them on the stage.I also have a Controller class which extends EventDispatcher and I dispatch all my events through this class. It's a central event class.

The problem is that I need to pass around a reference to this class so that all the other classes can dispatch and listen through it. Passing around the reference works but it's the exact opposite of loose coupling. I know I could make a static EventDispatcher that all the classes could see but then if I had two or three Player's on the stage they would all hear each others events.How can I create a type of sandbox that will allow all the child classes of a Player instance to be aware of the central dispatcher without passing a reference or making it static?

View 1 Replies

ActionScript 3.0 :: Unexpected Errors, Multiple Helper Classes, Extended Classes?

Jan 9, 2010

The examples I'll use don't do anything - they're classes without ANY members - no variables, methods, anything.

Let's say I extends Sprite and call it MySprite.

I save it in test.core

[code]...

Now I create another custom class called MyWindow that extends MySprite.

I save it in test.windows

[code]...

Then I create another class that extends MyWindows (the example I'll use is a document class - but that doesn't matter - I've tested using an instance too).

[code]...

Notice that I'm not even trying to instantiate the helper classes - just having them there throws the error.

If there is only a single helper class, everything runs fine.

Also note that - as far as I can tell - this only happens when extending one class from another package, then extending that class with more than one helper object.I'm pretty sure there's no namespace bumps or typographical errors, as this is a very pared-down version of the original application.

EDIT: seems the problem exists even without the crossing packages - even extending MySprite in the document class with multiple internal classes generates this error.

View 4 Replies

Flex :: Storing Instances Of Classes In Shared Objects

May 26, 2010

Is it possible to store instances of a class in a cookie or in shared objects.

Basically in my application I have an object "Diagram" that the user can create. If they hit save, I want to store the current instance as a cookie and allows them to reload it later.

Alternatively, I could see about getting them to store the saved version on the hard disk. But even then, all I want to save and retreive is my actionscript object.

I've tried storing the object to SharedObject.data.diag, but when I try to retrieve the object from the cookie doing SharedObject.data.diag as Diag returns null.

View 1 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

Flex :: Architect Extended Cairngorm Classes To Be Shared Across Applications?

Jun 5, 2009

I have created a few Event and Command classes for use in my Cairngorm projects.For example, I created an class that extends URL... that allows me to set callback functions upon completion or failure of the corresponding Command. To accomplish this, I also had to create a new Class that implements com.adobe.cairngorm.commands.ICommand that I extend for all Commands in my projects.Now, I want to use these two classes across all of my Cairngorm applications. What is the best way to do this? Should I just edit the Cairngorm source for CairngormEvent and ICommandand recompile the Cairngorm MVC (is that even possible)? Or add my two classes to the Cairngorm source and recompile the Cairngorm MVC? Or should I just add them to a shared library?I've chose the third option for now, but this requires that I reference the Cairngorm library in both my library and each project. I am wondering if there is a better practice and what the benefits are.

View 1 Replies

ActionScript 3.0 :: Alternative To Static Classes?

Feb 19, 2012

At the moment, my main classes game variable, is static, so I can access any class in the game, from any class in the game. However I keep getting errors related to the fact it is static; is there any alternative to this?

View 5 Replies

Professional :: Loading External Swfs Extending From Classes In The Same Shared Codebase?

Jul 25, 2011

I'm currently developing a game in flash and want to be able to divide up my .fla assets in a way that means artists can work on a game menu .fla in isolation from the game.fla and rest of the game code.If I could briefly explain how I've approached this so far, I would be extremelyMy project is setup like this:HighScoreMenu.fla -> document class HighScoreMenu extending GameMenu class.game.fla ->document class game.asgame.as class loads the published HighScoreMenu.swf and manipulates the menu i.e. animates on and off screen via inherited functions in the GameMenu class.

Now this seemed to work to begin with, until my code evolved and upon going to publish my HighScoreMenu.fla flash started complaining about symbols being used in Game.as that were in Game.fla... If I'm only publishing the HighScoreMenu which extends from GameMenu then why is it even looking to compile Game.as

View 4 Replies

Actionscript 3 :: Storing Array Of Custom Classes In A Locally Shared Object (LSO)

Sep 22, 2011

I am having problems storing an array of objects, all of which are the same custom class in an LSO and then reloading that array from the LSO without losing the class type of the objects in the list.

I know how to store a single object of a custom class and load it withe the correct class type using the registerClassAlias() function, but I cannot seem to apply this to arrays of objects.

I am trying to save an array called messageList. Each element is a custom class GameMessage with a property called gameLevel. After I load the LSO I am trying to do something like

trace("0th message is from level " + GameMessage(messageList[0]).gameLevel);

And I am getting an exception of like this:

TypeError: Error #1034: Type Coercion failed: cannot convert Object@90fdfa1 to GameMessage.

I have registered the GameMessage class using

registerClassAlias("GameMessage", GameMessage);

and everything works if rather than a list of messages I try and save/load a single message.

View 1 Replies

Xml :: Structure Classes To Avoid Using Static Functions?

Nov 16, 2011

I have a Flash application that creates a sort of powerpoint presentation. All the 'slides' are stored in an XML files which is read and processed.

I'm trying to build the presentation using this XML file. At the moment, my main class has it's initial function main and a static function processXML main initiates my database class with a function called initDB. One of my issues is that initDB forgoes processing because it's dependant on an event listener. On completion of loading the XML files, the event listener initiates my static function on my main to create objects from this file.

The issue is that because the event listener continues the processing (after an indeterminate amount of time), the functions are no longer controlled by the main class.

[Code]...

View 1 Replies

ActionScript 3.0 :: Using Static Variable To Create External Classes?

Feb 25, 2011

I've rarely used static variables or methods when creating external classes, but I have on occasion, and it's very useful when I need global access to a value. I've seen negative criticism on the use of the "static" keyword, but never understood why. Is there a right and wrong way of using it, or is this not true? I'd like to use it in a context similar to classes such as MouseEvent or TextFieldAutoSize, where there is a list of values globally accessible for identification purposes.

It allows better code readability, and also allows for easy customization in the future. The value of TextFieldAutoSize.NONE is "none", but as long as a programmer used the reference TextFieldAutoSize.NONE and not the string literal "none", Adobe could change the value of TextFieldAutoSize.NONE to be "hahahahaha" and everything would still work just dandy because (TextFieldAutoSize.NONE == TextFieldAutoSize.NONE) is still true even though ("none" == "hahahahaha") is not.

Is there any kind of negative impact on using static variables this way? Or even functions for that matter? I'd just like to clarify this before I go and build a large project around the idea this is perfectly okay.

View 0 Replies

ActionScript 3.0 :: How To Access Static Function From Runtime Classes

Jun 1, 2011

I load many classes in at runtime from external SWF's, accessing those classes is pretty simple, like so -
var currentDomain:ApplicationDomain = ApplicationDomain.currentDomain;
var modelClass:Class = currentDomain.getDefinition(className) as Class;
var model:Model3D = new modelClass();
However I've never tried to access static functions from a runtime class, and now I need to. How is it done? It seems like something that should be simple, but I haven't worked it out yet.

View 3 Replies

ActionScript 3.0 :: Classes - Why Static’s (not Available To Any Instances) Properties And / Or Methods Can Have A Public

Feb 17, 2009

I have a question about classes. I just learn that static means that functions and/or properties are specifics to a class, but is it a synonym of private? And why statics (not available to any instances?) properties and/or methods can have a public (available anywhere else (timeline)) access modifier? PS: I just start with classes.

View 6 Replies

ActionScript 2.0 :: Override Static Functions Of Flash Top Level Classes?

Jun 6, 2006

Is there any way to override static functions of Flash top level classes? Lets take Stage or Math for example. What if we want to change Stage.addListener functionality, is there any solution to this problem?

View 3 Replies

ActionScript 2.0 :: Classes - If I Change The Atrribute Instead Of Being Dynamic, To Be Static, It Does Work?

Jul 26, 2006

i'm trying to learn about clases, and i tried to make an easy XML loader, but i gotta a problem with the attributes that doen't take the value i provide with the att variable. it shows me on the trace statement like undefined, and for example if i change the atrribute instead of being dynamic, to be static, it does work.

Code:
class XMLS {
function XMLS(Path:String, textfield:TextField, att:String, n:Number) {
var miXML:XML = new XML();[code].....

View 2 Replies

Using Same Shared Objects Across Multiple FLAs?

May 4, 2010

I am creating a small game for a project im doing it is only ten levels long but I wish to include feature such as saving etc. I have one some research on Shared Objects and it seems to be the best method. The idea I wish to execute is to have at the end of a level after reaching the levels goal have a piece of code that runs and saves that the next level has been unlocked. This seems relatively simple. However i have done things awkwardly i think, instead of creating the whole game within a single fla. each level is a seperate file, eg. level1.fla, level2.fla etc. Is it possible to use the same shared object across multiple .fla's?

View 3 Replies

ActionScript 1/2 :: 1 Shared Object For Multiple SWF?

Sep 21, 2009

I have 2 ways of accessing info in my course files (SWFs): text-only and audio playback. I'd like to use shared object to store the user preference so it remembers the setting when navigating between screens. It stores info file but each file creates its own shared object.
 
for example:
<path to the swf>page1.swfcoursename.sol
<path to the swf>page2.swfcoursename.sol
<path to the swf>page3.swfcoursename.sol
 
Since it writes and reads the SOL file of its own folder, the user setting isn't remembered when switching pages.

View 3 Replies

ActionScript 3.0 :: 1195: Attempted Access Of Inaccessible Method Start Through A Reference With Static Type Classes:RollableChar.

Mar 12, 2009

This .as file was working fine yesterday and now Im getting this error.

View 3 Replies

ActionScript 3.0 :: Interacting Classes - 1119: Access Of Possibly Undefined Property DoWork Through A Reference With Static Type Class

May 12, 2009

I have two custom classes in the same package - sGallery and vChange - within sGallery how can I call a function thats inside vChange?

[Code]...

but gave me error: 1119: Access of possibly undefined property doWork through a reference with static type Class.

[Code]...

View 15 Replies

Actionscript 3.0 :: Classes - Error: 1119: Access Of Possibly Undefined Property Web2 Through A Reference With Static Type Class

Jun 29, 2009

I have a site with ScrollPanes, that are calling a Class on what to display. (so the movieclip that I want displayed in the ScrollPane has a Class name.) Within that movieclip (webScroll) that is being displayed in the scrollpane, I have 2 other movieclips (web1 & web2), with unique instance names and eventlisteners targeting those instances. when I preview my site, i get this error: 1119: Access of possibly undefined property web2 through a reference with static type Class.

View 1 Replies

ActionScript 2.0 :: Shared Object To Save Multiple Data

Dec 3, 2011

I am new to ActionScript. I am designing a calendar with schedule just like outlook calendar. I have 30 or 31 small text boxes for each month. I would like to save data in the text boxes so that data remains in that even when the file is closed. I used the following code and it works fine.

[Code]....

My question is, I have totally more than 360 text boxes for 12 months. How can I save all data using shared object? I tried loop, Array and function with the above code. But it did not work. You can also tell me if there is any other way to save data using PHP MySQL or ASP? If so how to do that?

View 9 Replies

ActionScript 3.0 :: Multiple Frame Labels - Shared Object Not Working

Sep 13, 2009

I'm working on AS3 on main timeline. I have 20 frame labels parte1 to parte20. On parte1 I have a preloader and SharedOject code. The preloader works fine. On parte8 I have a movie clip (whole_master), which contains three frame levels (g_level_1, g_level_22, and g_level_33). Each frame contains a level of a game. My sharedObject doesn't work.

Code:
//Saving data
var so=SharedObject.getLocal("learningGames", "/");
so.data.whole_master=whole_master;so.data.g_level_1=whole_master.g_level_1; so.data.g_level_22 =whole_master.g_level_22;so.data.g_level_33 =whole_master.g_level_33;
//testing if shared object exists
[Code] .....

View 2 Replies

ActionScript 2.0 :: [FMX] - Creating Shared Object Arrays For Multiple Users?

Aug 26, 2004

I am creating a computer game with a save game function which outputs the contents of an array to a shared object, so that users don't loose their place.However, I wish for this to work with multiple users, and realise that to do this I need a new seperate "folder" within the shared object being created for each new users data array.I know it must be something like....

// Define the shared object using a "sublevel" for each users data array...
_root.savegame.sublevel = sharedobject.getLocal("savegame"; "/");
// somehow dynamically change "sublevel" to the contents of the var "currentUser" as defined when the user logs in when the game loads up.

OR...

//Define the shared object but using a variable title for the actual SO...
_root.savegame = sharedobject.getLocal("savegame_currentUser", "/");
//with that "currentUser" being dynamically substituted for the contents of the var "currentUser" which is defined when the User logs in when the game loads up.

View 4 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

Flash :: IDE - Media Server - Get Multiple Users To Control One Shared Object

Nov 19, 2009

i am trying to develop a multiplayer game using the flash media server. Currently i can get multiple users to control one shared object but i need to have 2 users controlling seperate shared objects on the same stage.

[Code]...

View 1 Replies

ActionScript 3.0 :: Flex 1 Swf Loader, Multiple Swfs Importing From Shared Library?

Dec 15, 2009

I'm using Flex builder 3 for my main application (web-based), and I need to load multiple swf files built in flash cs4 (AS3) at different times. The flash swfs import assets from a separate flash swf used as a shared library. I'm using 1 swf loader in flex to keep 1 flash swf loaded at a time.Loading the first swf works fine, but loading subsequent swfs generates an error in importing from the shared library swf.

Here's an example of an error:

"ReferenceError: Error #1065: Variable sharedApps is not defined."

View 3 Replies

ActionScript 3.0 :: Make Function In To A Static Function And Call It From Other Classes

Sep 23, 2009

this is the function i want to turn in to a static function. just dont know how to make it a static function and call it from other classes. i think this would have its own file.

[Code]....

View 2 Replies

Media Server :: Write Remote Shared Object Sequentially When Multiple Users Are Connected?

Mar 31, 2010

I am using FMS3 and Flash CS3 (actionscript2) in a Flash based whiteboard application. Multiple users can join this whiteboard. I want to save chat text and drawing in same sequence as live time. I am using persistant remote shared object to save these data. But when i try to replay these data its not showing in same squence as live . I am generating unique slot for chat and drawing but still same error occuring.

View 8 Replies

ActionScript 3.0 :: How To Subclass Multiple Classes

Nov 5, 2009

How do you subclass multiple classes. I have a class that subclasses MovieClip. I added a new feature. Now its yelling that my class needs to subclass SimpleButton. I know there both part of the display class. But how do you subclass that?

View 1 Replies







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