Flex :: Add Classes And Functions To Loaded File?

Dec 17, 2009

I have a flex application that loads swf files and displays them using the SWFLoader object.is there a way to provide different classes and functions for the swf application to use? [code]...

View 1 Replies


Similar Posts:


Actionscript :: Call Functions Inside The Swf File Loaded In SwfLoader Of Flex App?

Nov 18, 2010

I have a swf file sample.swf which has its actionscript class in Main.as. This Main.as has various objects declared as public in it. For instance lets consider an object myData of class MyData (in MyData.as).

I am loading this swf file in my AIR app using swfLoader. I want to know how do I access myData.func() using swfLoader.loaderInfo.content.

View 2 Replies

ActionScript 3.0 :: Access Functions In The Loaded Swf File?

Sep 10, 2009

i don't know why the calling of the "currentFrame" function is not working

ActionScript Code:
function loadMovie(MovieName:String,targetName:MovieClip){
var mLoader:Loader = new Loader();
var mRequest:URLRequest = new URLRequest(MovieName);

[Code].....

View 4 Replies

ActionScript 3.0 :: Passing Functions Through Functions From Different Classes?

Dec 27, 2009

Let's I have a class Square that has a several functions. I want to call it from a class Grid, which is a group of Squares.So in the class file for Grid, how would I do this:

Code:
public function doSquareFunction(thisFunction:Function):void{
square1.thisFunction();

[code]......

View 8 Replies

ActionScript 3.0 :: Calling Parent Functions From A Loaded Swf File?

May 29, 2009

I have a main Flash file that loads up other SWF files using Loader objects.  I want to be able to call methods of this main object from within the loaded SWF files.  For instance, I want the loaded file to be able to add an event listener to the stage of the main file.  I've found this example:
 
[URL]

Which appears to do what I want, but I can't figure out how to implement it in my setup.
 
My 'main file' that loads up other SWF's is called 'main.swf' and has a document class Main.
 
My loaded file is called start.swf, and has a document class "Start".

[Code]....

How can I reach the stage from a loaded SWF?  Or at least, how can I call a function in my Main Class from the loaded start.swf file so I can move the functionality I need to the main.swf file?

View 5 Replies

Flex :: Combine Mutiple Movie Clip Functions Into A Single Swc File Or MXP File For Flash?

Feb 17, 2010

I have to build one MXP package for Flash (not Flex). But i have multiple components, somthing like HelpSymbolMovieClips(have its on class), one image holder. etc. I need to combine there swc file into a single MXP file.How can i make a all these multi movieClip functionality in a single SWC file. Am bit confused about the structure of the component which is having multiple functions/MoiveClips. like (Image gallery components.

View 1 Replies

Flex :: Actionscript Classes To 1 SWC File

Mar 13, 2010

I'm using Flash Builder 4 (the version after Flex Builder 3, so very similar to Flex Builder 3) and have a bunch of actionscript classes that I frequently need to reference. I have them in a separate folder/package to keep things clean.

I know that it's possible to create a SWC from these actionscript files. My question is how do I do it in Flash Builder 4 or Flex Builder 3. Do I need other tools? My objective is just to use the SWC in the project and keep things clean instead of dragging around all these files.

View 2 Replies

Flex :: Multiple AS Classes In One Swf File?

Oct 18, 2010

I'm trying to compile AS files using the mxmlc but the particular class depends on other classes. My command is something like this: mxmlc -includes classA classB -source-path=. com.example.com.classC.

This gave me classC.swf but when I loaded it, it was still looking for classA.swf and classB.swf. Is there anyway I can have just one swf file?

View 1 Replies

Actionscript 3 :: Flex 4 Two Classes In One File

May 4, 2011

Can I put two or more actionscript classes in one .as file like this:

[Code]...

It doesn't work in Flash Builder: "A file found in a source-path can not have more than one externally visible definition. classes:A;classes:B" If it possible, I'm going to ask next question. Can I place two or more packages with multiple classes in one .as file?

View 1 Replies

ActionScript 3 :: How To Use Functions From Different Classes

Apr 3, 2012

I have 2 classes, named Class1 and Class2. How would I use a function from Class1, in Class2?

View 4 Replies

ActionScript 3.0 :: Using Functions In Other Classes?

Jan 5, 2010

so I'm having this problem where one of my classes can't locate a function. The function it's trying to use is in another class, so I was wondering if there was something special you had to do. This is what I'm basically doing:
One class

Code:
package
{

[code].....

View 5 Replies

ActionScript 3.0 :: Passing Functions From Different Classes?

Dec 27, 2009

Let's I have a class Square that has a several functions. I want to call it from a class Grid, which is a group of Squares.So in the class file for Grid, how would I do this:

Code:
public function doSquareFunction(thisFunction:Function):void{
square1.thisFunction();

[code].....

View 5 Replies

ActionScript 3.0 :: Sharing Functions Between Classes?

Mar 9, 2009

I have Flash project that is set up something like this:

myProject.fla

- document class = myMenu.as

- the document class imports a menu item from menuItem.as (import menuItem;)

I have a function in myMenu.as that sets the text formatting for all the text fields on the page. I want to be able to use this same function in menuItem.as so that all the formatting is consistent & you only have to change it in one place. How do I access this function from both myMenu.as & menuItem.as?

View 2 Replies

ActionScript 3.0 :: Move Some Functions Into Their Own Classes?

Dec 17, 2010

okay, i'm refactoring a huge ActionScript file, and so trying to move some functions into their own classes.  why is this not working?  i've got a function in my primary class:

// ...
private var testBlock:Sprite;
public function testingINT() {
testBlock = new Sprite();

[Code].....

View 11 Replies

Flash :: Access Different Functions Between Classes?

Dec 13, 2011

I'm coding a small flash game, and wan't to access different functions between classes. In C# I'm used to just making it static, but I'm having some problems with it.Here goes:

Main.as
package
{
import Bus;[code].............

View 3 Replies

ActionScript 3.0 :: Call Functions In Different Classes?

Oct 27, 2009

I need to call a function that sits in a class called MainClass.The function call is made inside a class called Rooms.

I have an event that is supposed to call the function, but when I do I get[code]...

View 2 Replies

ActionScript 3.0 :: Passing Functions Between Classes?

Oct 27, 2009

This probably has a simple solution, but I'm a complete newb to actionscript and I could really use some guidance.I have a file, called Politismos.fla. The document class of this file is: com.plaidfox.PolitismosClassPolitismosClass.as is as follows:

ActionScript Code:
package com.plaidfox {
import flash.display.MovieClip;

[code].......

View 9 Replies

ActionScript 3.0 :: Accessing Functions In Other Classes?

Sep 8, 2011

I've been working my way towards better OOP design lately and I've come across a problem with accessing functions in other classes from my Main class. Here is the code:

Main.as

ActionScript Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
stage.addEventListener(KeyboardEvent.KEY_DOWN, fireBullet);

They are listening for functions that are within the Player.as class, these functions control the dynamics/movement of the player itelf. But for some reason I'm getting a 1120 error(access of undefined property). Basically how do you listen/access for functions within a different class?

View 5 Replies

ActionScript 3.0 :: Pulling Functions From Other Classes?

Sep 10, 2011

asically I have a Player class with methods (i.e. Moving the player) that I want to listen for and implement in the main class. To put it simply, I'm creating the player methods in the player class and then calling them in the Main class. But for some reason I'm having some trouble, I'm still trying to get used to all this OOP design.Here is the (Main) code, it's not alot:

ActionScript Code:
package
{

[code].....

View 9 Replies

ActionScript 3.0 :: Communicate Functions In Different Classes?

Mar 13, 2009

I have 2 classes

Code:
package com.MyClass.basics1
{
//importing classes to use[code]...

Is there any other way to reference a function ?

View 3 Replies

ActionScript 3.0 :: Call Functions From Other Classes?

Mar 12, 2010

in my Main class, i try to call a function from another class, but when i compile i get this error:1136: Incorrect number of arguments. Expected 1.i have seen some fixes involving an event in the OtherClass and (null) when i call it, but it dosent seem tohere is a code that describes my problem, what do i have to do to make this kind of code work?m i doing it wrong, or do i have to do something else?OtherClass

Code:
package{
import flash.display.*;

[code].....

View 3 Replies

Embed SWF File In Flex And Interact With ExternalInterface Functions

Sep 1, 2011

I use a SWF file that exposes functions and events using ExternalInterface. Here is an example of an exposed function:
ExternalInterface.addCallback("myFunction", ExecuteMyFunction);

If I embed the file in an HTML page, I can access those functions using JavaScript. Now, I'm embedding that same SWF file dynamically in a Flex app using the mx:SWFLoader component, something like:
<mx:SWFLoader id="myLoader" source="[URL]" autoLoad="true"/>

I'm trying to access those exposed functions and events, but I can't find how to interact with those from the Flex app. I would like to be able to call a function just like from JavaScript, like:
myLoader.myFunction();
How can I access a function that is exposed by the ExternalInterface within Flex?

View 1 Replies

Actionscript 3 :: Classes In Project Override Classes In A Flash CS3 SWC File?

May 6, 2011

I have an actionscript project which uses visual symbols from an SWC. I have a CheckoutButton which has the following class associated with it (compiled into the SWC in Flash CS3).

[Code]...

View 1 Replies

ActionScript 3.0 :: Mimicing The Until Functions - Load Of Global Functions In One File?

Nov 4, 2009

I'm trying to find a way to have global functions in my as project, similar to how flash does with stuff like the util functions (describeType()...), where you can just call the function wherever you need it. For example:

[Code]...

So when I call Test(), it prints out "hello world" fine. My problem comes in that I can't change the name of the Test function, and I can't add any other functions without compiler errors. Is it possible to have a load of global functions in one file, or do I have to split them up into separate files like in the example? Also, I know that I can make a Global class and call static functions like Code: Global.doSomething() but I'd like to know if there's a way to do it as flash does it (describeType(), getDefinitionByName(), etc), or rather, how does flash do it?

View 9 Replies

ActionScript 3.0 :: Call Functions And Classes From Variables?

Oct 20, 2009

I was wondering if ActionScript had some way to call functions and classes from variables, like they do in PHP:

function funcname() {
print "Potatoes come from tree";
}
$function = "funcname";
print $function;   // Prints out "funcname"
$$function();      // Prints out "Potatoes come from tree"

In case you don't know the syntax for PHP, you should know that anything perpended with a $-symbol is a variable.

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 2.0 :: Functions In Object Oriented Classes

Aug 4, 2009

I'm new to the object oriented stuff and I'm trying to learn how it works. Here's what I've started on - it's led to a few dilemmas. I have one flash file and two .as each with one class. In the timeline of the fla file, it reads:
ActionScript Code:
var FileObject:ScriptFile = new ScriptFile();
function onEnterFrame(){
FileObject.CallInput();
}

Call input is a function in "ScriptFile.as" that calls another function in "Input.as";
ActionScript Code:
class Input{
public function Input(){
} public function keyListener(target:Number):Number{
[Code] .....

In output, when I press Left, it will say -5 over and over again, and I'm trying to add to xpos value but that isn't happening.

View 1 Replies

ActionScript 3.0 :: Asynch Or Callback Functions Between Classes?

Apr 26, 2009

Im trying to load some data, but I want to outsource the job of data loading to different classes.lets say XMLLoader class will get the url and return an xml file. The problem now is that such procedures are asynchronous, the class has to wait for XML to load and then call back the caller class and return the xml data.One way of doing this, is returning the data with a custom event. once its loaded then dispatch this event with the data in. However, I was wondering, if there is a way to do it with some sort of asynch call, meaning the caller class sends the request, then waits for a response.is such a thing possible? is there a better way or do I need to stick to my custom events?

View 2 Replies

ActionScript 3.0 :: Constructor Functions Of Multiple Classes?

May 16, 2009

I have a rather general question regarding OOP. How do constructor functions execute with multiple class extensions? I'm making an orbital physics simulation, and every spatial body is of the class SpaceObject, which extends Sprite. Then, I have all earth-type planets be of the class Earth, which extends SpaceObject. There are certain parameters that I'd like to set for every single SpaceObject (like position and size) in the constructor function, and certain parameters (like density and mass) that I'd like to set in the constructor of class Earth.But from the main timeline, when I create an instance of class Earth, I can only enter the parameters of the Earth constructor, ie

Code:
var planet1:Earth = new Earth(density, mass)
Or I can create an instance of SpaceObject:

[code]......

View 2 Replies

Actionscript 3 :: - Access Objects Instantiated In Flex App's MXML File In Other Classes

Jul 29, 2011

I've got an object declared and instantiated in my Flex application's singular MXML file: public var CDN:CDNClass = new CDNClass; I would like to access this same CDN object (and its public methods and properties) in another class declared in a separate .as file as such:

[Code]...

But when I try to access the public method parsePlayList in the CDN object in a method in the class defined in the .as file, I get the following error: Access of undefined property CDN The reason I want to do this is to break up the logic of my application into multiple AS files and have minimal MXML files, probably only one.

View 2 Replies







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