ActionScript 3.0 :: Accessing AS Classes In A MXML Document?

Sep 21, 2009

how to put actionscript classes into an MXML document? Lets say my class represents a movieclip, a rotating triangle for instance. How do i put that into a <mx:vbox> containter? I can do the AS work in a <mx:Script> tag, but how do i embed my class instance?

View 2 Replies


Similar Posts:


Flex :: Classes Must Not Be Nested - MXML

Jan 7, 2010

I'm trying to build a simple FLEX application. Unfortunately, I get '1131: Classes must not be nested.' errors even with the simples MXML .... the error pops out at the mx:Application openning tag: (I'm using PureMVC if it's important)

<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"

[Code]....

View 2 Replies

ActionScript :: Using MXML Components As Classes?

Jun 20, 2010

I have two MXML component files and try to work with them as classes. One of them has a simple function:

GUIFriend.mxml
<mx:Script>
<![CDATA[
public function createName(f:Friend) {
return 'friendProfile: ' + f.uid;

[Code]...

View 2 Replies

ActionScript :: Flex - Get MXML And Classes Out Of Swf?

Jun 2, 2009

Is there a possibility to generate the source out of the swf-file? I mean for example if I have my Actionscript and MXML files and compile them to a swf, can I get the source back out of the swf file?

View 2 Replies

Flex :: Have Multiple Layers In Mxml Document?

Nov 2, 2009

Is it possible to have multiple layers in a flex mxml document?What I actualy want is a panel with a form in it, but with a movieclip as a background.

View 1 Replies

Flex :: Accessing A Class Within Mxml Tag?

Jul 24, 2010

I would like to provide my own sortItemRenderer within an AdvancedDataGrid like so:

<mx:AdvancedDataGrid sortItemRenderer="MyRenderer"></mx:AdvancedDataGrid>

MyRenderer is a class that I wrote, but Flex doesn't see it and gives "defintion not found" error, because it is not within the mx namespace. What is a clean way to make this to work?

View 1 Replies

Flex :: Access The Root Element Of A MXML Document If Can't Set An Id?

Aug 30, 2010

If I wanted to do something like this:

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalScrollPolicy="off"
verticalScrollPolicy="off"

[Code].....

How would I get a handle on myCanvas (where I'd want myCanvas to be the root )?

View 2 Replies

ActionScript 3.0 :: Accessing Properties Of External MXML?

Sep 16, 2010

I have written "components" in external .mxml files like dialogs and such. For example, GamePropertiesDialog.mxml. These components are used by another file, Main.mxml for example. If I instantiate a GamePropertiesDialog I am unable to access its pieces like a textbox with an id of GameName until AFTER I add the dialog to the display list.Doesn't work:

Actionscript Code:
var tmp:GamePropertiesDialog = new GamePropertiesDialog();tmp.GameName.text = 'test';addChild(tmp);

Does work: Actionscript Code:
var tmp:GamePropertiesDialog = new GamePropertiesDialog();addChild(tmp);tmp.GameName.text = 'test';

View 1 Replies

ActionScript 3.0 :: Accessing A Button In An Mxml Component From Other

Aug 1, 2009

I have a two components Test_Interface.mxml & teacher_fullscreen.mxml. I called teacher_fullscreen.mxml from Test_Interface.mxml by

[Code]...

Now I created an instance of Test_interface in my 2nd mxml by

Code: public var par:Test_Interface=new Test_Interface(); Actually, I wanted to disable a button in Test_interaface.mxml with id = "b1" from my 2nd mxml using the object created above. So I gave par.b1.enabled=false; It did not give any compile errors but during run time cannot access object or method of null reference sandbox error was returned for the statement par.b1.enabled=false. So how do I change the property of a button in one component from other.

View 0 Replies

Flex :: Grid - Error Accessing To Property In (mxml)

Nov 23, 2011

I have an MXML file with this:

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="30">
<mx:Script>

[Code]....

View 1 Replies

Flex :: MXML Views - Passing Dependencies Into Constructor Of Classes

Oct 6, 2009

I'm used to building applications using pure AS3. I always pass dependencies into the constructor of classes I make, but this method seems to not work out well for Flex MXML views. It seems like I should define setters on the MXML class, which map to attributes in the tag/class instantiation. But using this method I cannot specify which properties are required and in what order I expect them etc. What is the preferred method to give a Flex view it's dependencies?

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

ActionScript 3.0 :: MXML Code - Charting Flex Document Listing Repository Statistics?

Feb 19, 2010

I have been working on a charting flex document listing repository statistics for work and it can be seen here -http [url]...orialJorum.swf Unfortunately,my hard drive died last week and the MXML source files were wiped(I know I should have backed it up). As I cant really afford paying $80 to decompile to get the MXML script, I wondered if anyone could do it for me as I put many hours into that piece of work. I have tried using the demo version of SWF Decompiler and Trillix but unfortunately they only give you the component code and not the <script/>

View 3 Replies

Actionscript 3.0 :: Preload The .swf Itself Using Document Classes?

Mar 24, 2009

I'm trying to go from inline scripting to document class, and having a very hard time going there..! at the moment I'm trying to preload my flash/swf'en, when loading it in html.

I've managed to do it inline style,check out an example here

this flash has 2 layers, a script layer and a content layer. each layer has 2 frames. in the first layer I have this code:

Code: Select allimport IndexPreloader;   
var _indexPreloader:IndexPreloader = new IndexPreloader();
setupPreloader();
function setupPreloader():void {

[Code].....

when using this setup, it's as if all the content of the .swf is loaded before the preloaderen is started.. so the preloader has nothing left to preload and starts and stops almost at once.

View 4 Replies

Actionscript 3.0 :: Communicate Between 2 Document Classes?

Aug 31, 2010

I have 2 different swf files with their own separate document classes. My first SWF file is main.swf and it's document class is called Main.as (its the main container that loads in external swfs). The file being loaded into main.swf is called step1.swf and it's document class is called Step1.as. I have a next button in step1.swf that when clicked needs to tell the document class controlling my main.swf (ie Main.as) to load in the next external swf. However I don't know how to call a function in one document class to from another document class. And I don't know if that fact the swf calling the function being loaded into the other makes this situation more complicated. I've looked around but I cant seem to find the answer anywhere. Basically I need these two separate document classes to communicate between one another.

Here is the code for Main.as (the doc class for the container SWF):

Code: Select allpackage
{
import flash.display.*;
import flash.events.*;

[Code].....

how to get swfNavigation() to run from the other class

View 1 Replies

ActionScript 3.0 :: Communicate Between Document Classes?

Aug 30, 2010

Let me explain the situation that has been driving me crazy the last couple of hours. I have 2 different swf files with their own separate document classes. My first SWF file is main.swf and it's document class is called Main.as (its the main container that loads in external swfs). The file being loaded into main.swf is called step1.swf and it's document class is called Step1.as. I have a next button in step1.swf that when clicked needs to tell the document class controlling my main.swf (ie Main.as) to load in the next external swf. However I don't know how to call a function in one document class to from another document class. And I don't know if that fact the swf calling the function being loaded into the other makes this situation more complicated. I've looked around but I cant seem to find the answer anywhere. Basically I need these two separate document classes to communicate between one another. Here is the code for Main.as (the doc class for the container SWF):

[Code]...

if someone can show me how to get swfNavigation() to run from the other class

View 2 Replies

Actionscript 3.0 :: Accessing A Document Setter From Fla?

Oct 3, 2011

I'm trying access my Document class (Manager) from within a movieclip in my fla, to set one variable within Manager. Manager is within the folder "code", and just like any class it's simple enough to write "var mng:code.Manager;", except I'm not sure how to define Manager:

"var mng:code.Manager = new Manager();" gives "Error #2136 .swf contains invalid data", for what seems to be the general redundancy of initiating the Document class again from the fla.So, how do I reference the Manager, so that I can simply write "mng.setVar = whatever;"?

View 1 Replies

ActionScript 3.0 :: Importing Classes Without Using Document Class

Feb 2, 2011

I have 2 as3 files, which are the classes used . I have to use it with the main flash movie.. How will I include those as3 files without using document class..

View 4 Replies

Actionscript 3.0 :: Document Classes And Multiple Scenes?

Sep 2, 2010

I've been searching the internet for how to use scenes in flash games, and from what I understand it got some problems? MY problem is that i cant really understand what the problem is and I cant find i "clean" explanation.

Some say you dont should use scenes in game development, some say you should?? Im confused.

Another thing that i dont understand quite is the document classes. Should i have one document class for every scene or one for all of them?

If i have 2 scenes with it's own document classes, how do i switch between them?

View 4 Replies

ActionScript 3.0 :: Document Classes And Library Instances

Jul 14, 2009

1. I've got a Main Document class, that loads external swf each with its own document class (they are pages and pieces of the site).

2. The Main class makes use of some movieclip simply instantiated from the GUI library. It all goes fine.

3. The external swf have references to the Main class, and here start problems: when I compile them, I get an error for every library mclip used by Main. See the attachment. A simple trace(Main) is enough to start getting all that errors.

A partial solution is to uncheck Strict Mode in publish settings

View 10 Replies

ActionScript 3.0 :: Document Classes And Multiple Scenes

Sep 2, 2010

I've been searching the internet for how to use scenes in flash games, and from what I understand it got some problems? MY problem is that i cant really understand what the problem is and I cant find i "clean" explanation.Some say you dont should use scenes in game development, some say you should?? Im confused.Another thing that i dont understand quite is the document classes. Should i have one document class for every scene or one for all of them?

View 1 Replies

ActionScript 3.0 :: Accessing Instance Of Document Class

Jun 5, 2009

I have a really peculiar problem that relates to the old question of how to best access the instance of the document class from a different class. I usually add a 'this' as parameter when I create an instance of another class inside the document class. Then I save this 'this' in a class property of the type 'Object'. It usually works just fine but lately I have encountered a really bizzarr error.

When my movie first starts I have to load 2 xml-Files. I do that in another class - that calls upon the document class instance when it is finished. I use 4 methods for that, each calling the other, when it is finished.
(like one doing loader.load(urlRequest),
then loader.addEventListener
(Event.Complete, nexthandler) and so on

Now, when I call back to my document class from the last of these 4 methods it works just fine. But when I try skipping the first two methods (since I now need only one xml-File) - my try/catch-statement suddenly complains: TypeError: Error #1010! Like it needed more time to establish the instance of the document class or something similar strange.

View 4 Replies

ActionScript 3.0 :: Accessing Properties Of The Document Class?

Nov 14, 2009

when I try to access a property of the document class from another class, I get an error:

Quote:

1119: Access of possibly undefined property _left through a reference with static type flash.displayisplayObject.

Maybe I'm not doing it correctly? This is how I've been accessing document class properties so far. Does the fact that they're private make a difference?

Quote:

root.property

View 1 Replies

Accessing A Stage Instance From A Class Other The Document?

Dec 19, 2010

I have a main document class with another class instanciated (mouse follower.as) within it. I want the mouse follower class to access a stage instance. How is this done?

View 1 Replies

ActionScript 3.0 :: Document Class, And Accessing Properties?

May 25, 2009

I'm currently working on an interactive app, (site) which requires me to modify a few textfields, and change images dependant on the user choice (using mouseevent). This is a separate module, thus I'm posting the question in here instead:there are three images, that are lined up, with a textbox next to them. When a image is chosen, and enlarges, the text changes with the chosen image, according to XML.The textFields, 'text_title', 'text_description' are contained in a movieclip, called 'textbox'.This has been built in the Flash IDE (CS3) named info.fla/swf, which refers to a Document class 'com.info', made in Flex Builder 3...I attempted to modify the textfields using this:textbox.txt_title.text = "Loading";textbox.txt_desc.text = "test";But, I was unable to at first to change the text using the document class, as it gives "1120: Access of undefined property <variable>".

View 3 Replies

ActionScript 3.0 :: Accessing Function In The Document Class?

Nov 24, 2009

I have an instructions.as file which is trying to call a function in the document class through a mouse click event listener and am getting a 1009 error.

Here are my to actionscript files:

** this the the instructions.as**
package Elements{
import flash.display.MovieClip;
import flash.events.*;

[Code].....

View 3 Replies

ActionScript 3.0 :: Accessing A Function Of The Document Class?

Mar 29, 2011

My project is structured as following :

- a fla file with movieClips on the timeline , this fla is linked to the Main class

- a Main class who does some randomization of the animations

- a MenuItem class which function is to give each button menu the same functionnality

the problem is that I'm trying to access to the randomNumber function inside the Main class from the MenuItem class to prevent the rewriting of the function inside this class. I've made some research on Google and apparently I have to create a Singleton class so I can access the Main class from everywhere, I've followed those instructions but it still doesn't work, when I trace the Main class from the MenuItem class it gives me a Null result!Main Class code :

Code:
package
{
import flash.events.Event;[code].....

View 4 Replies

Accessing A Public Variable Between Classes?

May 25, 2009

I've got two classes running...one is a document class (EgoGame.as) and another is a class linked to several similar movie clips (Ball.as).I'm trying to access a public variable from Ball.as which has been declared in the doucment class EgoGame.as.When I run the test the outputs states the following...1120: Access of undefined property _ballPlaced.Here's my code.  What I'm trying to do is remove the event listeners from the Ball.as when the _ballPlaced variable is true, so that the user can't drag and drop the balls after they've been placed in a zone.

Document ClassEgoGame.as
package
{

[code].....

View 3 Replies

Professional :: Accessing Object Classes?

Apr 9, 2010

I have a project that i'm working on, and in the project it's important that i have an object that i can create with actionscript that already has two arrays inside of it. To do this, i made the movieclip, i checked export for actionscript in the library, and in the custom class that corresponds to that object i made the arrays with the following code:

package {
import flash.display.*;
public class cont extends MovieClip {

[code]......

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







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