ActionScript 3.0 :: Access Of Undef Prop Error - Making Private Variable Public

Apr 27, 2010

I have the below script as part of a small application I'm building. The script just creates cue-points along a movies timeline so we can add events etc to those cue-points.

[Code]....

It's creating the cue-points well, although I'd like to use the below variable outside of this function.

Code: var stampName When I try and use it I get an access of undefined property error, which I believe relates to the variables being private and within the function - but I can't seem to find a method to get this varibale public.

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Multiple Classes Accessing The Same Variable Without Making It Public?

Dec 26, 2006

i've got two classes and i'm not extending to MovieClip. I like to attach the mc in the constructor just because i'll be working with different MC's that have the same purpose.

however, im using private var loadedMC:Movieclip and now i've got another class that needs to be able to access the instance's variable.

for example, myClass.loadedMC , but this would mean having to make it public and I rather not go that route.

View 2 Replies

ActionScript 3.0 :: Cannot Access Public Variable

Nov 28, 2009

I think I've made some fundamental error here... I have a public variable a in class A, and I want to access it in class B, but I cant (access of possibly undefined property...) now every time I want to refer to a variable in class A I need to pass the variable reference to class B's constructor

View 4 Replies

ActionScript 2.0 :: Access To Private Var In Private Function For OnPress()?

Aug 11, 2010

here is a snippet of my code in an as file

ActionScript Code:
class PoolBall extends MovieClip {
private var poolBall:MovieClip;

[code].....

View 4 Replies

ActionScript 3.0 :: What Does Public And Private Mean In This Statement

Jan 25, 2009

what does public and private mean in this statement and when do I need to use it?this is not my code just using it as an example.

package {
import flash.display.Sprite;
import flash.net.URLRequest;
import flash.net.URLLoader;

[code]...

View 5 Replies

ActionScript 3.0 :: Error 1180 Can't Access Public Functions?

Sep 17, 2011

No idea what I'm doing wrong here, it just won't let me access any of my public methods on my class. I just keep getting "Error 1180: call to a possibly undefined method"!

If I run the same function in the constructor of the class everything is fine.

[Code]...

View 13 Replies

ActionScript 2.0 :: OOP: Private Array Property Still Public?

Feb 25, 2005

In my project I've defined a Point class to build Point objects. I also built a Polygon class with a (private) array property, Points. The polygon class contains a method getPoints() which return the current Points array. My objective is to built one or more Polygon objects and assign several Point objects to the Polygon's Points array. Let's say I've created two Polygon objects, plgPolygon01 and plgPolygon02. To both objects I insert three new Point objects into the Points array.

As I call the plgPolygon01.getPoints() method, i expect to get an array with three values. But when I do this, I get an array with six values. So I conclude: while I was inserting Point objects into the Points array of a Polygon object, this Points array seems to be public instead of private. Otherwise, I'd only get the Points I assigned to the first Polygon object and not all the Points assigned to polygons.

View 3 Replies

Media Server :: Configure Public And Private IP Address In FMS?

Jul 26, 2010

How to configure Public and private IP address in Flash Media Server?

View 6 Replies

ActionScript 2.0 :: Makes No Difference Public - Private And Static

Sep 10, 2004

Im just starting to get my hands into Action Script v2, and Im having a really hard time working out what the difference is between Public, Private and Static Variables, it seems that declaring variables in these types makes no difference what so ever to the avaliablility of my variables... Could someone be so kind as to put me on the right path?

View 2 Replies

Actionscript 3 :: Calling Private Functions By Changing Public Variables?

Jun 13, 2010

i've never tried to do this before, so my head a swimming a bit. i'd like to have a public boolean called enabled in myClass custom class. if it's called to be changed, how do i trigger a function from the change? should i add an Event.CHANGE event listener to my variable?

View 1 Replies

ActionScript 3 :: Handling Public / Private IPs On Developing Of Socket Server

Jan 20, 2011

I am developing a chat server were my users log in using any of my clients applications with a very simple implementation of the TCP protocol. When the user logs into, the client sends a raw text to the server indicating some parameters like username, others, and the most important the WAN ip. This data gets stored on ther server database. After the execution of a algorithm who search for other online user in the database, the server sends to a pair of users the ip and the username of the other user, so later the clients can connect to each other directly wihtout using the server anymore. So, the server acts only like a meet point. Well all this works fine is the users arent inside of a private network, like a wireless router. The clients are programed in AS3 using XMLSocket and the server using VB6 with winsock.

View 1 Replies

ActionScript 2.0 :: Difference Between Private And Public Method In Custom Class

Jun 12, 2007

I have this sample class
Code:
class TestPrivate{
public function TestPrivate(){};
private function getGo(){
trace("can execute");
}}

And then after instantiate I just calling the method...for testing the "public" and "private" keyword purposing only...

Code:
import TestPrivate;
var obj1 = new TestPrivate();
obj1.getGo();

The result is still can be execute even though I put the private keyword in front of the methods. So what's the private keyword stands for actually...I thought it prevent been get accessed from outside...

View 2 Replies

ActionScript 3.0 :: Private Static Properties With Public Static Getters/setters

Oct 22, 2009

how bad is this practice? I am having trouble getting to some stuff so i am taking the easy way out

Code:
private static var _interrupted:Boolean;
public static function setInterrupted(value:Boolean):void{
_interrupted = value;
}

View 1 Replies

ActionScript 3.0 :: Access Object In Private Function?

Jan 15, 2010

how to retrieve these in other functions.

In my main class (package) I have a function (tipTrendHandler) which creates an object TextBox. The instance in the example is ttrend. The class is imported. However when trying to access the object and apply e.g. a method, declared in another function (e.g. displaySequence) it seems this object is unknown.

ActionScript Code:
package com {
import flash.display.*
import com.mycompany.TextBox;

[Code]....

View 1 Replies

Flash :: Expose A Method In An Interface Without Making It Public To All Classes?

Nov 7, 2009

I have a issue where I'm working with a particular interface for quite a lot of things. However, I have a particular method that I want to be available only to a particular group of classes (basically, an internal method). [code]...

View 4 Replies

ActionScript 3.0 :: Static Method Can't Access Private Properties In Same Class

Jul 24, 2010

Why static method cant access private properties in the same class?

View 1 Replies

ActionScript 3.0 :: Private Variable In Class - Accessing Array?

Apr 9, 2011

I have a class that creates an array from a config xml file. I set a private variable in that class and use a getter in other classes to access the array. The routine that uses the array does the following:
- Call the getter and assign the returned value to a local (private) variable tmpArray.  the getter is a simple return() using a value that is established in the constructor.
- Uses a for loop to itterate over the contents
- Uses array.shift() to pop the item in tmpArray

The next time I run the routine, the contents of the array is empty. I'm using the same getter. I implemented the getter when I tried to manage both arrays in the same class figuring that as long as the original array was private (i also tried static), that the value would not change. I have since worked around the problem by moving the routine that fills up the original value from the constructor to the getter. So, consider the following code:

import flash.events.Event;
btn.addEventListener("click", btnHandler);
var myArray = new Array();
var myTmpArray = new Array()
myArray = ["one", "two", "three"];
myTmpArray = myArray;
function btnHandler(evt:Event) {
[Code] .....

If I create a variable myVar and set it to 1 then set myOtherVar = myVar, the both equal the same value. If I change the value of myOtherVar, myVar is not affected. But using the shift() method changes both the original and the copied array.

View 5 Replies

ActionScript 3.0 :: Error 1013 For Private Functions?

Feb 7, 2012

I've been trying out a platform game and am focusing on the shooting aspect of it from a tutorial through youtube, the person doing the tutorial never explains the errors they fix between videos. I received an Error 1013 and I just can't figure it out, even looking at other codes.Line 29 is the issue.

ActionScript Code:[code]..........

View 6 Replies

ActionScript 3.0 :: Access Public Static Var?

Jun 16, 2011

So my question is how i can access public static var from an external loaded swf?

View 9 Replies

ActionScript :: Error: 1120: Access Of Undefined Property MyRec On A Defined Variable

Nov 20, 2011

I'm trying to write a dollar recognizer in Flash Builder. actionscript and mxml, and I''m getting this error on the line "myRec.addTemplate..." in the code below:

import de.yuv.gestures.Recognizer;
import flash.display.Graphics;
import flash.display.Shape;

[Code].....

View 2 Replies

ActionScript 3.0 :: Accessing A Class Private Variable In The Main Timeline?

Jun 2, 2011

Here's my main class:
 
[code]...
 
in the timeline I have a dynamic text box named my_textbox: var my_test:main = new main(); my_test.check_DVBViewer(); my_textbox.text = ??Basically the class waits for the callback variable (my_msg). The problem is: I need to set the dynamic textbox text to my_msg variable. How can I access it? I know I can access a public var in the timeline with functioname.variable but I can't define a public var inside a function, right?

View 3 Replies

ActionScript 3.0 :: Access Of External SWF's Public Methods

Apr 23, 2009

How would I access a loaded in swf files public methods in my main swf. 
 
var temp:ExternalSWFLoader = new ExternalSWFLoader("FX_Ticker.swf");
temp.x=temp.y=0;
Ticker =(Sprite)(temp);

[Code]......

View 18 Replies

Flex :: Access A Public Function Outside Of The View It Is In?

Feb 6, 2012

I have been working on a Flex Mobile application using Flash Builder 4.6. I have 2 mxml 'views' in my project. In one mxml file, i have a function that grabs xml data. In my other mxml file, I have a refresh button that when depressed is suppsosed to call the function in the first mxml file in order to once again grab the xml data. I dont know how to call that function from outside the mxml file it is housed in. [UPDATE #2]* I thought I should share some more details about my issue.

It is a reddit client mobile app. It fetches the feeds, etc. In my main view called RedditReaderHomeView.mxml, I am using a splitViewNavigator spark component to house two other views like so:

[Code]...

View 2 Replies

ActionScript 3.0 :: Access A Public Method In (swf) New ApplicationDomain?

Jul 29, 2009

How to access a public method in the swf loaded in a new ApplicationDomain?

ActionScript Code:
var appDomainA:ApplicationDomain = new ApplicationDomain();
*
var contextA:LoaderContext = new LoaderContext(false, appDomainA);
var loaderA:Loader = new Loader();
loaderA.load(new URLRequest("application2.swf"), contextA)

I want to access a public method in application2.swf from the main swf that loaded it.

View 8 Replies

ActionScript 3.0 :: Passing A Variable To A Function - Get "error: Access To Undefined Property MyVariable?

Apr 9, 2010

It seems that with as3, the error compiler is just waiting to get you.I have a function that loads in an external swf. Which swf depends on which button they click. So, it could be pic1.swf, pic2.swf, pic3.swf, etc.

function loadMovie(){
my_mc.addChild(my_Loader);
addChild(my_mc);[code].........

When i test, I get "error: access to undefined property myVariable.

View 2 Replies

Private Function And Private Variables In Flash?

May 25, 2011

there are classes definitions where all their methods are private my question is why are they private, because i've tried a code wherein i changed all the private access modifier to public and nothing changed!

what if you make an instance of that class with all its method private, how are you be able to access that on another class. coz i know private methods are only accessible to the class where they are declared! will the instance of that class be able to access the superclass's private methods!

on private variables, it's still not clear to me as to why make a private variable and then use a getter and setter, when you can simply make it public! are these variables called static?cause on the way i understand it private functions and private variables are static?

View 1 Replies

Flex :: Security - Limiting Web Service Access To Public

Oct 6, 2009

I have a flex application which collects data entered by the user and posts it off to a web service I have running on a back end server. The flex application does not authenticate users (it's available for anyone to use without setting up an account) and communicates to the web service using HTTPS. There is an XML firewall in place for preventing certain malformed requests, DoS attacks etc and the web service validates all data received from the client.

If I was to sign the content then I could use the XML firewall to verify the signature but I assume that any certificate type data I embed in the client could be extracted out of the flex app through some means of de-compilation. My question is, is there any way of limiting calls to the web service to only those from my flex client? I understand that a user could input bad information but I'm really trying to prevent another client or 'bot'.

View 2 Replies

Flex :: Access The Public Properties And Methods Of A Loaded SWF

Mar 18, 2011

How would you go about calling the public properties and methods of a SWF you load in actionscript?

I have been using stackoverflow for years to answer my programming questions so I wanted to give back by writing a guide to an issue I had a lot of trouble figuring out. This is my first user guide so tell me if there is anything I can do to improve it.

View 3 Replies

Flash :: AS3 - Access Class Public Var From Inside Fla File

Oct 24, 2011

I have searched for this everywhere but it seems like every answer is either overcomplicated or simply does not work, and I know for sure there should be a more simple way of achieving what I need. So, until today, I have always coded from within the timeline. But now I realise why I should code in separate class files. However, I still want to include snippets of code in the timeline for simplicity's sake.

[Code]....

View 2 Replies

ActionScript 3.0 :: Access Public Var/functions In The Document Class?

Mar 27, 2011

How do I acsess public var/functions in the document class?

View 7 Replies







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