Flex :: Cannot Add Method / Function To Class Of Existing Project?

Mar 28, 2011

I'm totally new to Adobe Flex Builder 3. I've been assigned a fully functional project but when I want to add the simplest function to any class, I always got the same error :
Call to a possibly undefined method through a reference with static type

For example, in some random class there is a function defined like this :
public function GetID() : String { return m_strID; }
If I try to define a new one like below :
public function GetIDFoo() :String { return m_strID; }

And then I try to call both of them like this:
trace ("This line is ok : " + oPhysicalScreen.GetID());
trace ("This line gives me an error : " + oPhysicalScreen.GetIDFoo());
[Code] .....

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Add Method To An Existing Class?

Jul 3, 2006

how I might go about adding a method to flash.display.Graphics so that I can call it just like I would drawRect()

for example, graphics.drawDottedRect()

I tried extending Graphics with a new class called Graphics and adding my function but this does not work. I'm sure that the display object is making its graphics instance from the real flash.display.Graphics class and not my extended class.

View 2 Replies

ActionScript 2.0 :: Adding Method To Existing Class?

Jul 5, 2009

I'm trying to make a new method for the XMLNode class and I want to use this method in other classes of mines that manipulate XMLNodes. Here's what I did :

1. I wrote an Ext class which you can read here :

[Code].....

It didn't work (saying that myMethod doesn't exist), so I added this line "static var e : Ext = new Ext();" before "function Testing () {}" Then my method worked. I don't understand why but great.

3. The problem is that I want to use the method not only in the main function but also in other classes of the application. However, when another class tries to call the custom method, it says that it is not defined. I don't know how to solve that.

Additional infos: I'm using the Eclipse IDE rather than the traditional Flash IDE so I don't have such a thing as "the first frame". My app only has the main function.
-MTASC which compiles my code doesn't support #include

View 1 Replies

Flex :: Compile An Existing Project With The SDK

Jun 20, 2010

I'm trying to compile an existing Flex3 project with the Flex4 SDK. I'm getting this error:

Warning: This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option.The resulting file is roughly the same as my old Flex3 compiled .swf file. Playing the resulting .swf file in the Flash Player also gives the following errors:

An Actionscript error ocurred: VerifyError: Error #1014: Class spark.core::SpriteVisualElement could not be found If I set the compiler attribute static-link-runtime-shared-libraries to true, then the error disappears and all is well. However, the size of the resulting .SWF is a couple of 100K's bigger. And that's not what I want.

I don't fully understand the concept of runtime shared libraries, but it seems that with the option to statically link them set to true, the libraries are included in the .swf. However, I like to exclude them from the .swf and only load the needed library at runtime, as my project seemed to do with Flex3 (I didn't know that by the way).

If I understand correctly, playerglobal.swc should hold all the necessary code for the external libraries that my .swf has to load. Do Flex4 compiled files need more libraries? Should I do something with the factoryClass in the Frame metadata tag?

I think my question boils down to this: How do I compile a Flex4 .swf that is the same size as my previous Flex3 compiled .swf?

View 3 Replies

Flex :: Rebuilding Existing Flash Project

Nov 23, 2010

I'm not a flash developer.We paid a developer to build us an app. It is nearly perfect, but a few things in the actionscript need tweaking (purely the values of some URL's for action when buttons are clicked.)I believe I need to rebuild the project to pull this information through.I believe he has sent me the full source. Do I need to install all of the dependencies to get this to work? I'm tempted to just go in and make the changes in a hex editor..

View 1 Replies

Actionscript 3 :: Edit An Already Existing Flex Project?

Nov 18, 2011

I am trying to edit an already existing Flex project, and I see a warning on the line "import com.Adobe.utils.StringUtil;" and the warning it shows is

Multiple markers at this line:

-mx
-The import utils could not be found.
-The import StringUtil could not be found.

Well I was wondering what is the difference between import com.Adobe.utils.StringUtil; and import mx.utils.StringUtil;

View 2 Replies

Flex :: Adding Flex Capabilities To An Existing J2EE Enterprise Application Project

Sep 17, 2010

I have an J2EE Enterprise Application Project in which I would like to add a few Flex screens. How do I go about adding Flex capabilities.

I have build Flex/J2EE applications from scratch but can't think of the best way to do this.

I am currently using Flex Builder Plugin for IBM Rational Application Developer 7.5.

View 1 Replies

Flash :: Builder - Know Exact Flex Sdk Version From Existing Project Files?

Nov 23, 2011

I received an inheritance old flex project. I've never worked with Flex. I installed the latest Flash Builder and I need to know the exact version of used Flex SDK. Is there any way to know used SDK version from project files?

View 2 Replies

Flex :: Sequence Flex/Actionscript Method/function Method Calls

Aug 11, 2011

OK, from what I know actionscript in Flex runs asynchronously. I need the ability to run a method in a loop synchronously. Consider this code:

public class CustomerContainer extends VBox
{
public function CustomerContainer ()
{

[Code]....

This is not my exact situation as it is a bit more complicated to explain here. There is an abstract class and several custom view objects derived from it. Some of the views are dependent on others being completed first but I cannot seem to order them in the correct order. TIMERS are not an option. Probably not explaining this correctly.

View 2 Replies

ActionScript 3.0 :: Flex - Construct A Derived Class Instance From An Existing Base Class Instance?

Jan 22, 2010

I have a base class which is being created via remote_object [RemoteClass alias] from the server.I have other specialized classes that are derived from this baseclass, but serialization with the server always happens with the base class.The base class has meta data that defines what the derived class is, for example

[RemoteClass (alias="com.myco...')]
public Class Base
{

[code]....

View 2 Replies

ActionScript 3.0 :: Calling A Function From Method In Class?

Jan 28, 2009

I create an instance of an object - This is on my main.fla

ActionScript Code:
var newClass:MovieClip = new myClass;
newClass.myFunction();[code]....

I've tried putting parent. before it etc - just to note this isnt my actual code I'm working on but a simplified version of it.

View 7 Replies

ActionScript 3.0 :: Configure Dropdown Into Existing Project?

Nov 19, 2010

I have a project which was completed, now I need to add a dropdown menu but how do I impliment the code into the existing actionscript I have?

ACTIONSCRIPT / CURRENT
var Xpos:Number = 0;var Ypos:Number = 0;var swf:MovieClip;var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("swfs/home.swf");

[code]....

View 6 Replies

Flash :: Use A Method Of A Class Inside A Callback Function ?

Sep 13, 2011

When you call a method of a class inside a callback function, you can not use this object.To call the method, in javascript, I declare that variable, assign this to that, and use that inside the callback to call the method of this.In actionscript, do I have to do the same way as I do in javascript?The following code is the example to use that to call a method inside callback.Are there more simple way in actionscript?

class C {
private var that:C;

function C() {[code]......

View 6 Replies

ActionScript 3.0 :: Override Class Method With Dynamic Function?

Oct 7, 2009

override a custom class method with a function expression? For instance, if I want to change the destination of a button on the fly, I could theoretically type:

Code:
var new_destination:Function = function(evt:Event):void{ go_to_new_place();};
myButtonClass.mouse_clicked = new_destination;

but unfortunately that generates an error because the class method "mouse_clicked" is already defined in my class (with the eventListener tied to it). I tried using the "override" keyword in the Function Expression but that didn't work either.

View 3 Replies

ActionScript 3.0 :: Call Function From External Method In Same Class?

Jan 30, 2010

For some reason I cant figure this out,I have a function thats in a method in a class..I have a second method in the same class, trying to call the function from the second methodeg:

Code:
package com.sarin
{

[code].....

View 4 Replies

Actionscript 3 :: Add A Pre-loader To An Existing Complex Flash Project

Aug 31, 2010

I have a pretty complex flash project that I need to add a pre-loader to.

Currently all the items we have are in the Library inside the .fla file. I've been reading a few of the pre-loader blog entries and tutorials and getting nowhere.

I've tried to create another .fla file that loads the compiled .swf file of the complex project and that did not work as well.

This is my first flash project and I'm pretty inexperienced with it. What do I need to do?

Do I have to strip all the items from the library and load them individually (and have them saved somewhere on a server) ?

How can I create a loader class within the project that runs on Frame 1 and "Loads" all the items that are needed?

View 1 Replies

ActionScript 2.0 :: [FMX04] Calling Function On Movieclip From Class Method?

Sep 15, 2007

Is it possible to call a function defined in a movie clip from a class?Here's a sample project setup I'm trying to achieve this simple feat:

func.fla
- Has one movieclip "fooinst" which is library item "foo".
- The "foo" library item has linkage is to the "Foo" class
- The "foo" library item has one script on it's first frame:

[code]....

View 2 Replies

Flash :: Create Adobe Air Application From An Existing FLASH8 Project?

Jan 7, 2011

Is there any simple way how to pack existing Flash8 project using AS2 and multiple files to to Adobe Air application?

View 2 Replies

ActionScript 2.0 :: Class Function Tunnel - Access Property Inside Method

Jun 1, 2006

I have a simple quesiton about class, method and functions inside a method and class properties. I created a new class form my custom component.. But upon developing it I found out that you can not access a property inside the function which is also inside a method..

Example
Code:
class myClass{
private var myProperty:Number = 1; //default is 1
//constructor
public function myClass(){
}//Method
[Code] .....

What I want to do is to access the property inside the method.. I also have a work-around still i cannot point a certain variable to a property of my class inside the method's function..

View 2 Replies

ActionScript 3.0 :: Flex Project With A Class As Entry Point?

Jul 22, 2009

is it possible to create an actionscript project (File > New > Actionscript Project) and still use mxml for the ui layout? basically, i want a main class as the entry point which can reference the controls within the mxml.i tried it the other way around (File > New > Flex Project), but it creates an mxml app that seems to serve as the entry point. if i create a class in this project, how do i make it the main entry point?//when i create this class inside a flex project, the constructor never gets called

Code:
package
{

[code].....

View 3 Replies

Actionscript :: Vector Class In A Flex Library Project?

Dec 20, 2009

i seem to be having some problems with the Vector class in actionscript 3 in a Flex Project or an ActionScript Project it is possible to do this var v:Vector.<String>; But when i do the same thing in a Flex Library Project (to create an SWC) then i get the following error on that line of code 1046: Type was not found or was not a compile-time constant: String.

so when using Flex Library Project it fails..., but when i compile the same thing using compc there are no problems any idea why only the library project is complaining about Vector ?

[Code]...

View 5 Replies

AS3 :: Flex - GetTimer() Method And The Timer Class?

Jun 18, 2009

I'm in the process of making a game (a shmup) and I've started to question the accuracy of the timers in ActionScript. Sure, they're accurate enough when you want to time things on the order of a few seconds or deciseconds, but it seems to perform pretty poorly when you get to finer ranges. This makes it pretty tough to do things like have a spaceship firing a hundred lasers per second.

In the following sample, I tested how long (on average) the intervals were between 1000 timer ticks intended for 30ms. Time and time again, the results are ~35-36ms. Decreasing the time, I found the floor on the timer delay to be ~16-17ms. This gives me a max fps of ~60, which is great visually but also means I can't possibly fire more than 60 lasers per second :-(. I ran this test a few times at 100 and 1000 loops, but for both the 30ms test and the 1ms test the results didn't change. I print to a textField at the end because using trace() and launching the swf in debug mode seems to negatively affect the test. So what I'm wondering is:

Is this test a decent measure of the Timer class's performance, or are my results questionable? Will these results change dramatically on other machines? I understand this is dependent on the getTimer() method's accuracy, but the discussions I find on this topic usually center around getTimer()'s accuracy on larger intervals.

[CODE]...

View 5 Replies

Flex :: Calling A Static Method Of A Class With Only An Instance?

Jul 27, 2009

If all I have is an instance of an object, can I call a static method of its class? For fun, let's say I don't know what the name of the class is, only the name of the static method.

View 3 Replies

ActionScript 3 :: Flex - Wait For Class Method To Complete?

Aug 30, 2010

I'm currently creating a website with AS3 in FlashDevelop, so it's code only no timeline stuff.

I have a class that loads images with a method that I call from my main source. I was wondering how I go about making sure that the images are loaded before executing more code outside of the class. I know how to do it using Event.COMPLETE in the image class, but I am unsure how to get the main class to wait.

View 1 Replies

Flex :: Require A Function Parameter To Be A Static Constant Of The Function's Class?

May 22, 2009

Let's say I have a Custom Event Class, and it has several Event types stored in static Constant:

[Code]...

Is there an easy way to validate that the type passed to the Constructor is one of the Static Constants of the Class, without having to check it against each value?

View 5 Replies

Flex :: Determine When A Method Or Property Was Added To A Player Or SDK Class?

Sep 11, 2009

I recently found a method (ByteArray.clear()) that FlexBuilder complains is possibly undefined; however, the method is in fact documented in the Flex LiveDocs. It must have been added in a later version of the SDK than I have installed. I'm not asking about this particular method, but I'm giving it as an example of the documentation issue that I'm trying to resolve. My questions are:

How can I determine what version of the SDK or Flash player that a method or property was added in? How can I tell which versions of the SDK are supported on which Flash player versions?

I want to be able to determine from the documentation, instead of compiler or runtime errors, what SDK and Flash player versions are needed to support newly added methods.

With Java I look for the @since javadoc tag when I need to know this, but I can't find an equivalent feature in the Flex docs.

View 3 Replies

Flex :: Programmatically Get Documentation Comments From A Class , Method / Property?

Dec 11, 2010

I know that I can get info about constants, methods, etc of a class by using flash.utils.describeType. But I want to know if I can retrieve the asdoc comments of a class member.

I suspect, documentation is removed when classes are compiled into SWF so it might be impossible to get comments during run-time.

View 2 Replies

Xml :: Flex - Getting Warning: 3594: Parent Is Not A Recognized Method Of The Dynamic Class XML?

Jan 26, 2010

It's coming from this line of code:var dropTargetXML:XML = XMLTemplate.template.component.section.question.(@question_questionID == nNode.parent().@question_questionID)[0];nNode is an XML node sent as an argument to the function this is called in. The code runs,and does everything expected but the compiler sends out that warning. Do I have some formatting issue?P.S. I've tried telling it that it's XML like this:var dropTargetXML:XML = XMLTemplate.template.component.section.question.(@question_questionID == XML(nNode).parent().@question_questionID)[0];

View 1 Replies

Android :: Convert Flex Mobile Project To Flex Web Project?

Jun 29, 2011

I have a flex mobile project and I want to convert it into web-based project. What is the best way to do it.

View 1 Replies

Flex :: Any Method In Module Class Where I Can Hide And Show Based On User Login?

May 19, 2010

<?xml version="1.0"?>
<!-- This module loads an image. -->
<mx:Module width="100%" height="100%" [code]..........

I have such 10 modules. Is there any Method in Module Class where i can hide and show based on user login.

View 1 Replies







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