Actionscript 3 :: Accessing Functions/Vars From Outside Of Class?

May 29, 2010

how can i call public functions or vars of a sprite class from another class (or frame script)? i keep getting 1061: Call to a possibly undefined method getSide through a reference with static type flash.display:Sprite.

//Framescript
var a:Sprite = new customRect();
addChild(a);

[Code]....

View 2 Replies


Similar Posts:


IDE :: Compiler Doesn't See Functions And Vars From Class?

Jan 7, 2010

Lately I changed Flash CS3 for CS4. In older version classes written by me worked fine. However, in CS4 I have serious problem with them. Compiler states that part of my functions and vars are undefined, which is not true. I tried everything - changing name of class, functions, moving class file to different directory, removing package. I even counted { to check if they have pairs. I'm really out of options what can cause those errors.

Here are error given by compiler:

1120: Access of undefined property mnChangeMan.
1120: Access of undefined property ChangeManSliders.
1120: Access of undefined property ChangeManInput.

[Code]....

View 5 Replies

ActionScript 3.0 :: [CS4] Compiler Doesn't See Functions And Vars From Class?

Jun 27, 2011

Lately I changed Flash CS3 for CS4. In older version classes written by me worked fine.However, in CS4 I have serious problem with them. Compiler states that part of my functions and vars are undefined, which is not true. I tried everything - changing name of class, functions, moving class file to different directory, removing package. I even counted { to check if they have pairs. I'm really out of options what can cause those errors.Here are error given by compiler:

Quote:
1120: Access of undefined property mnChangeMan.
1120: Access of undefined property ChangeManSliders.

[code].....

View 2 Replies

ActionScript 3.0 :: [CS4] Compiler Doesn't See Functions And Vars From My Class

Jan 7, 2010

Lately I changed Flash CS3 for CS4. In older version classes written by me worked fine. However, in CS4 I have serious problem with them. Compiler states that part of my functions and vars are undefined, which is not true. I tried everything - changing name of class, functions, moving class file to different directory, removing package. I even counted { to check if they have pairs. I'm really out of options what can cause those errors.

Here are error given by compiler:

Quote:

1120: Access of undefined property mnChangeMan.
1120: Access of undefined property ChangeManSliders.
1120: Access of undefined property ChangeManInput.

[code]....

View 1 Replies

ActionScript 3.0 :: Accessing A Class's Static Functions From A Variable Of Type Class?

Feb 19, 2010

I realize this is kind of an odd issue, but I am wondering if there's any way to get Flash to allow me to access a class's static functions using a class variable that points to the class. Example:I create a class called FooClass that has a static function named fooI then create a variable of type Class that points to it

Code:
var class:Class = Class(getDefinitionByName("FooClass"));
However, when I try to call foo() using the variable, it errors saying the function

[code].....

View 6 Replies

ActionScript 3.0 :: Accessing Functions From One Custom Class To Another?

Sep 9, 2009

I've made two custom classes ("banana" and "box"). As I start my application I create two new objects from these classes - first I create a banana object and then a box object. The banana class/object has a property/variable ("weight") that I set with information from an external XML file, thus it takes a while for it to receive a value.

My problem is that my box object needs to access the "weight" property of the banana project, just after the box object has been created. The problem is that the banana object hasn't finished initialising when I make the request from the box object...

Is there a way of either check the status of another class (initialisation status that is), or is there another way of preventing the box object to either be created before the banana object is initialised?

View 2 Replies

ActionScript 3.0 :: Class Files And Accessing Functions In Them?

Dec 14, 2004

Short description of my project:I'm making a "flash-car-damage-registration-program" where a user can click on a part of a car, make two choices (from two comboboxes) that describes the damage, and then save it in a datagrid withing flash.I have split up the code in different class files:I have a damage.as class file that describes the damage and its properties.I have a carPart.as class file that extends the Movieclip class. This sets all the propertiesof each carpart and where the roll-over/out eventlisteners are, pluss som escriptive text to each carpart. This works the way I want it to. This is just to quickly give you an idea of what I'm working on.So to the real question or problem: I have a LoadMyXmlData.as class file where I load some xml data, this works fine. A function in this class takes a combobox and a xmllist as parameters.

I want to populate the mentioned comboboxes from the xml data. Both comboboxes are on the stage within another movieclip, but I can seem to access them. (yes, they have instancenames etc) I get error 1120: 'Access of undefined property'. I have tried ways like: containingMc.comboboxMc' and so forth but no luck. I have been searching the web for days for a solution to my problem, but nothing so far.

View 1 Replies

ActionScript 2.0 :: Accessing Class Functions/variables In OnLoadInit?

Jan 27, 2008

class fial
{
public var num = 5;

[code].....

View 1 Replies

ActionScript 3.0 :: Accessing Stage/global Functions Inside A Class?

Apr 16, 2010

I have a .as file with a load of functions that i include using : include "myFunctions.as".They can be accessed alright.I have a custom class that extends movieclip, and i want to use a function inside that class that is located in my "myFunctions.as" file.How do i do that? Seems like the class loads before the myFunctions.as file so the functions are unavailable at this time. I get that error message :

View 7 Replies

ActionScript 2.0 :: Calling Functions From Vars?

Feb 7, 2006

PHP Code:

function finale(){    finalFunc = "section" + _root.selectedSection    finalFunc();}_root.selectedSection = 1finale();function section1(){trace("moo")}function section2(){}

View 1 Replies

ActionScript 3.0 :: Can't Set Vars For Functions Of Event Listener

Feb 9, 2010

why can't we set vars for functions of a Event Listener. To be more specific, this is my code:

Code:
package
{
import flash.display.MovieClip;

[Code].....

View 2 Replies

ActionScript 3.0 :: Flex Protected Functions And Vars?

Oct 11, 2009

since i started using Flash Builder (Flex 4) i could see that it can auto-generate some handlers for example if i have a <s:Button> and i add a click="" i get a hint of "Generate Click Handler" and when i click Enter he writes this code:

Code:
protected function button1_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
}

Now i knew about public and private things(functions/vars) and if a function was public i could execute it form outside of the class and inside. But if it was private i could only execute it from inside of the class and i couldn't execute it from outside of the class.

So anyway, what does "protected" mean? what does it do?I was thinking that if i load a SWF in my app I can go inside of that SWF and execute functions, read values from variables, or anything like that ... and that seems like a security problem ... So i was wondering if the "protected" keyword could help me with this security problem. And if not, I would like to know what is it good for

View 5 Replies

ActionScript 2.0 :: Reset Vars In Penner's Functions

Jan 6, 2004

i am builiding a photogallery where at each stage i load six thumbnails. Each "placeholder" is initially set to 20% xscale and yscale and when each thumb has fully loaded, i want to have the thumb tween from 20% to 80%. The jpg thumbs are loaded inside the placeholder.when the thumb has fully loaded, goodToGo = 110 and so i want to trigger the AS tween.[code]to get some idea of how it would look, check out URL...and click inside any of the collections.

View 1 Replies

ActionScript 3.0 :: Accessing Vars In Custom Components?

May 26, 2009

I'm working in flex, but using as3. I have two components, and need to communicate between vars. I have my main app, and  two components. I declare "newsDB" in the main app like this.

[Code]..

This gives  me an error like so TypeError: Error #1009: Cannot access a property or method of a null object reference. I get that it is trying to touch the var before it is implemented. How should I go about this?

View 3 Replies

ActionScript 3.0 :: Accessing Vars In Loaded Movie?

Oct 7, 2009

I'm trying to access a variable from my main movie in a loaded movie. I can't get it to work however. The movie loads into the main movie but I can't access anything from that main movie. I see that there a few write ups out there about this, but I just can't get it. I attached a zip as well as the source below.

here is the main movie script

function mainTimeline() {
trace ("Just friggin work already");
}
var myNumber:Number = 5;

[Code].....

View 3 Replies

ActionScript 3.0 :: Accessing Vars In SuperClass From SubClass?

Jun 12, 2005

So, how would you create a class that can access a variable in the class where the subClass was created(superclass), I realise this might be unclear so in example

PHP Code:
package {import flash.display.MovieClip;public class Main extends MovieClip {public va demoString:Strin = "TEST";public static var newClass:SubClass;public function

[code].....

View 12 Replies

ActionScript 3.0 :: Accessing Vars In SuperClass From SubClass

Feb 24, 2012

So, how would you create a class that can access a variable in the class where the subClass was created(superclass), I realise this might be unclear so in example

[Code]...

View 14 Replies

ActionScript 3.0 :: Counting Function / Passing Vars Between Functions

Jun 21, 2010

Could anyone suggest how to fix the function at the bottom so that when button forward_btn with label "Go to next Training Point" when clicked recalculates the fields created in function fileLoaded.[code]

View 2 Replies

ActionScript 2.0 :: Accessing DuplicatedMovieClip Dynamic Text Vars?

Oct 5, 2003

I have an xml content loaded in AS and to that content I made a movieClip to show that content.I'm duplicating that movieClip according to the quantity exposed in xml.My problem is that when I duplicate de movie clip, I don't find a way to contact the dynamic texts variables.Her's the dynamic texts vars:- client_number;- client;- ...Her's the code:

Code:
var my_xml = new XML();
my_xml.ignoreWhite = true;

[code].....

View 5 Replies

ActionScript 3.0 :: Sharing Vars Between Document Class And An Imported Class?

Jan 27, 2009

I've been sorting through the XML docs and i've bumped my head into a bit of a question. So, to preface, I have been able to load the XML successfully, but I want to be able to use my own XML loader class to load the XML and then be able to reference it from the document class. Also, I'd like to be able to send a file path to the loader class when I call it.

The document class:

ActionScript Code:
package rg.sites{
// flash classes

[code]....

View 8 Replies

ActionScript 3.0 :: Accessing Child Functions?

Sep 14, 2010

I would like to ask on how do you access a child's function in AS3 I have tried "ChildMovieClip.childfunction();" so far it does not work.

View 3 Replies

Actionscript 3 :: Functions And Accessing Variables?

Jul 14, 2010

I'm trying to create a JW player plugin, a part of the source code is shown below:

public function initPlugin(player:IPlayer, config:PluginConfig):void {
api = player;
var streamUrl:String = 'xxx';

[code].....

View 1 Replies

ActionScript 3.0 :: Accessing Objects In Other Functions

Jan 15, 2009

I'm working on a flash video player and I'm trying to figure out how to access something inside the constructor that I know is set but it keeps telling me its not.

[Code]....

now in the metadata function its giving me the error, "Access of undefined property video" Now, am I just completely not understanding how classes work or is this a common problem?

View 4 Replies

ActionScript 3.0 :: Accessing Functions From A Loaded SWF?

Jun 30, 2010

I have a file which loads a series of SWFs. It loads one, allows it to play to completion, then stops. Right now, it will just wait for the user to press a button and select the next one. However, I need it to play them sequentially. Is there any way for the SWFs which get loaded to access the functions which control the SWF loading?

View 4 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 2.0 :: Accessing Functions In Loaded Swf

Sep 8, 2008

I'm sorry if this has been answered 1,000 times, but I am so confused with everything!! In the main timeline of my movie, I have a container movieclip called "content". I want to load an external swf into content, and then access the functions in that swf. I can load it no problem, but I can't for the life of me figure out how to access the functions, I can't seem to find it anywhere!

View 3 Replies

ActionScript 3.0 :: Accessing Mc Functions From The Root?

Sep 22, 2009

How can i access a function that is in a movieclip from the root?

i've tried these :

mcName.functionName();
MoviClip(mcName).functionName();

but all of them didn't work at all.

View 1 Replies

ActionScript 3.0 :: Accessing Arrays In And Out Of Functions?

Nov 21, 2005

I'm creating a soundboard, and and I've been using Flash for about 2 weeks and Actionscript for about a week, so you'll have to excuse my ignorance. I've used google to look for specific things to no avail so here I am.Okay, so, I have a soundboard that, when pressing a button, it will hide or show certain buttons on the page, to give the feeling of multiple pages. All my visibility stuff works like a champ.

Right now, in the working version of my soundboard, I'm not using functions to instantiate my linkable objects, create the array, or populate the array to hold the linkable objects. I would like to use functions to make my code less obtuse. I looked around for a while trying to figure out how to pass an array of objects into a function but i haven't had much success. I'm not quite sure if it's even possible to do. These are the errors I get:

1120: Access of undefined property playArraySound001.
1061: Call to a possibly undefined method play through a reference with static type Class.
1120: Access of undefined property playArraySound001.
1120: Access of undefined property GordonSoundArray.
1136: Incorrect number of arguments. Expected 1.

The first code is what works, the next code is the stuff that doesn't work.This is the working version

Code:
//////////// CODE FOR PLAYING SOUNDS
//// This is creating an instance of the Linkable object
var playArraySound001:Link_10_minutes = new Link_10_minutes();
var playArraySound002:Link_3_eggs = new Link_3_eggs();

[code]....

View 5 Replies

ActionScript 2.0 :: Accessing Outside Variables From Functions?

Aug 1, 2004

how to access variables that are declared in a movie clip from a function declared in that same movie clip.

i.e.
****************************
var int1 = 1
var int2 = 2

[Code]....

I'm trying to do this in the main movie clip of a movie that I plan on importing dynamically in another movie. I've tried to use this.int1++, but I think that flash was looking for a variable that belongs to "myfunction" when I did that. I could just use _root.int1++ but like I said, I plan on dynamically loading this into another movie, in which case it would be pointing to the wrong movie.

View 2 Replies

Flash :: Javascript - Accessing Functions Through JQuery

Aug 29, 2010

I use the following jQuery code to access functions in my SWF (FP 10.1 SWF embedded via SWFObject): $('#FlashApp')[0].someFunc(); This works fine in every browser.. except for Internet Explorer (surprise!). Surely, the point of jQuery is to make this code work across all browsers? I'd really rather not write extra code to check for IE. How can I talk to my SWF in a browser independent way?

View 3 Replies







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