ActionScript 3.0 :: Make A "Read Only" Property?
Aug 17, 2009Is there a way to make a "Read only" property?
I would like to be able to do " = somthing.property" but NOT "something.property = " (unless it is in a subclass).
Is there a way to make a "Read only" property?
I would like to be able to do " = somthing.property" but NOT "something.property = " (unless it is in a subclass).
Is there a way to make a property read only from outside of the class?
View 5 RepliesI'm iterating the public values of an Object... is there a way I can efficiently determine if any particular property is read-only or write-only(i.e. is a get/set but not both)?
View 3 Repliesone thing i've never really understood about AS3 is that you can't have a private set method and a public get method together. from within my class i would like to assign values that would call a private set function:
[Code]...
is there no way to use the set keyword on a private function?
I have an FLV player that provides a read-only property called myPlayer.timecode and it displays the time in seconds as a String (xx.xxx).I am trying to assign that value to a variable so I can convert it to a number to use in some calculations, comparisons, etc. I can assign this property to a dynamic text box and display it on the screen, but I cannot assign it to a variable and have the variable value show correctly on the screen. What do I need to do?Ex: myPlayer.timecode value is 10.000 and shows as 10.000 in the dynamic text box called myTime1. (I entered the property into the Var: input box).Created a String variable called timePlayed, and assigned it to a dynamic text box called myTime2.However, I cannot find a way to assign the property myPlayer.timecode to this variable. I can only display a value of "undefined" or "NaN" in the text box myTime2.
View 3 RepliesI need to make a SWF that should show some data from the DB. The DB will be read using PHP.I was thinking that the SWF would get the data by accessing "data.php" and data.php will read from the DB. The SWF would read the XML/JSON/RAW DATA from that file and update it's variables.
View 1 RepliesIs there a way to make frames be read backwords?Like if i want an animation to stop, then all of a sudden be played backwords, is there any actionscript that would allow me to do that?Or do I have to copy and paste the frames backwords?
View 1 RepliesHow do I make so Flash read's a notepad.txt document?
View 5 RepliesBasically I have a Dynamic Text Field, whose value should be derived from a database, BUT should not be allowed to be modified by a user! The same issue applies to an Input Field.
View 4 RepliesHow do I make so Flash read's a notepad.txt document?
View 5 RepliesIm trying to make my TextArea read multiple lines to a string
Hello
my name
is Bryan
in the textArea
outputs to HellomynameisBryan
how can I get it to output with line breaks?
As the title says, suppose I have an hypothetical XML containing this:
[Code]....
I can check if a certain speech has a bg change by simply doing this:
if(bgs[i])
{
//true!
}
what should I compare in the case of sounds, I've tried many, like:
[Code]....
I have a class like this. Property "isPag" is based on filed "ecboardid", I found that when ecboardid is changed, UI controls seem not be able to detect that "isPag" is also changed. So, how to make a property like this bindable?[code]...
View 3 RepliesI'm trying to extend a class like panel so that I can fire click events only when the title area is clicked on. The title area is a protected uicomponent of Panel called titleBar. So I want to make that component public.It seems like I'm almost there but I'm getting a "TypeError: Error #1009: Cannot access a property or method of a null object reference." when it tries to add an event listener to the titlebar.
here is my extended panel
package custClass{
import mx.containers.Panel;
import mx.core.UIComponent;
public class ExtPanel extends Panel{
[code]....
And then this in the AS:
newPanel.getTitleBar().addEventListener(MouseEvent.ROLL_OVER,over);
Still getting the same error.
I have Class1 with a read-only bindable property called age:
public class Class1 {
private var _age:int;
[Bindable(event="ageChanged"]
[Code]....
Of course the [Bindable] tag there doesn't make sense. But how can I achieve the same effect?
I believe I can dispatch some sort of ageChanged event from Class2 up to Class1 and then have an event handler in Class1 dispatch another local ageChanged event to which I bind Class2's age property.
I cannot find and information on how to make a dynamic sharedObject data property.
Simplified Code for what I need/want to do
var iData:SharedObject = SharedObject.getLocal(userInfo);
var dataArray:Array = ["a","b","c"];
var property:String = "prop"
iData.data.this[property] = dataArray;
That is what i was thinking.
It doesn't matter how the property is created, just that it needs to be done on the fly.
I'm in the midst of creating an extremely rudimentary game show display. It will essentially function like the big screen in Jeopardy.
I want to be able to have this operate in four stages. First stage: One frame will have all the question categories and values laid out in a grid. Second stage: I will click on a category and have it link to a frame that displays a question. Third stage: Once my participant answers the question, I will click once more and be linked to a frame that has the answer. Fourth stage: I click a link back to my initial grid of questions, but the category I just went through is now a different colour/blacked out/faded
I can do steps 1-3 quite easily, I just don't know how to make step four work. Just to clarify, say all the questions are in blue and I click "History for 200". I want to be able to go through, answer that question, come back to the grid, and have "History for 200" now be in red (or something). This would have to work for multiple questions, as it should show the participants which questions have already been asked.
I'm a quick learner and am just looking for the actionscript or whatever that requires this. My question wasn't really short enough for searches of Google and this forum to yield anything.
How do you make the childAllowsParent property of an SwfLoader go from false to true, that is, how as a parent application do you set up security to make the child app's events and other properties accessible to you. To read the flex docs on this, one would think nothing could be simpler:
"This property [childAllowsParent] is set to true if the child object has called the allowDomain() method to grant permission to the parent domain or if a URL policy is loaded at the child domain that grants permission to the parent domain. If child and parent are in the same domain, this property is set to true . [emphasis added]" So, I'm in a development environment and want to load an swf from my own system via an SWFLoader and then be able to monitor its events within the parent app.
[Code].....
Is there anyway to make it so that globalVariablesArray[0] always contains the 'new' value of theState.stateGrowth, even if it changes? In other words, store the property itself in the array, not just the value of it?
View 1 RepliesI was wondering if anyone has any input on my question.I've been trying to figure out for a few hours now how to make words or sentences animate in and "pause" for a few seconds (for the user to read) and then continue to play. I know I can tween it, but I wanted to do it via actionscript. I got it to animate in and come out but i couldn't figure out how to have it hold for a few sec. I will have more than one sentence animate in and out.
View 8 Repliesi been trying to figure out a way to make sure my property values from my xml file are fitting sweetly into my classes.
using 'property is XClassType' pretty much tells me if its an array, boolean, number. But strings are a bit weird. Even though the property is declared public var some:String the below test doesn't trigger it being set to a String. Are Strings different than Boolean, Array, Number, etc.?
Code:
if (myTarget[i] is String) {
trace("prop is string");
myTarget[i]=String(mySource[i]);
}
A friend of mine has a Flash Action script running on a LAMP server that currently reads an xml config file. He's asked me if it's possible to remove the xml file, and replace it somehow with a system (lets call it an 'auto xml generator') that intercepts the request to read that file and generates an output, so it appears to all intents and purposes as if the file still exists and contains the contents that has actually been returned from our auto xml generator'
View 3 RepliesSo I want to read http streams using flash tcp sockets. I do not really need the http header at all - all I need is body which contains flv. so how to read http response body into byte array using flash sockets?
View 1 RepliesSetting the text property of a flex DateField makes the selectedDate property of that DateField go to null.I need to set the text property so that I can use a particular format (DD-MMM-YYYY).
View 2 Repliescan I use the Class datatype to make a class a property, then create new objects from that class? Like so:
class Foo{
private var ExampleClass:Class;
public function Foo(exampleClass:Class){
[Code]....
Lately i discovered MATE (for Flex development) and was wondering: how do i bind a property in a view (actually a navigatorcontent component) to another property in a class so that they stay in synchronization (meaning that whenever the property in the class changes the property in the view also changes).
So if we have a view called Target.mxml and a property targertProp how do we bind it to the class called SourceClass with property SourceProp?
What's the difference between selectedChild property and selectedIndex property? I read the documentation, both seems to be setting currect active accordion. selectedChild can be only used in actionscript, but other than this, what's the difference?
View 0 RepliesCan we put [Bindable] on functions/methods? I know that bindable is used to change the value of the source property to destination property. But not sure if we can use that for methods. why we cannot put/ if we can then what will be the outcome?
View 1 RepliesI have a class Inhabitant with a property skin which is of type DisplayObject.
Within Inhabitant I need to access the x and y properties of skin using this method:
this["someProperty"];
Rather than:
this.someProperty;
This is fine with properties defined within Inhabitant but I'm not sure how I could do this for a property of skin. This obviously doesn't work but it might give you an idea of what I'm trying to do:
this["skin.x"];
The reason behind requiring this notation is that I have a function which I can parse a String though that will represent a property:
public function addTokenable(property:String):void
{
if(!isTokenable(property))
_tokenables[property] = true;
}
And then a related getter that will return a representation of this instance of Inhabitant as a String:
public function get token():String
{
_token = "class:" + getQualifiedClassName(this).split("::").join(".");
[Code]....
I'm wondering if there is a way I can bind a flex property to flash property?, the flash property is inside a swc file created in flash with the Flex Component Kit for Flash Professional, I can manipulate the flash component as a regular flex component, but I want to bind their properties, is there a way?
View 1 Replies