ActionScript 2.0 :: Convert A Read-only Property To A Number
Jun 28, 2007
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.
Code: cnx.addEventListener(CNXConnection.DIGITAL, onDigital_10); function onDigital_10(e:DigitalEvent) {
[code]....
While debugging everything works properly if I'm testing that frame.But, pushing a button in another frame, I get the following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference at "frame number:raw number"
I'm quite sure that the problem is that the variable e.Join changes its corresponding e.Value pushing a particular button in another frame (as must be). Any ideas how to link that information to the frame that create the error?
I am using two comboBoxes that contain number say 1-50.I am trying to read the value of the comboBox as a Number.I have tried selectedItem,selectedLabel,and value.For example say I wanted to try this
I'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)?
I have an animation that reads some info from a txt file (such a bkg color, bkg image and text). So I would like to make my main animation in the root to repeate a segment of the animation (beteween 50 and 80 frame) or to loop an MC so many times like the number of lines in this txt file.
For exapmle if I have in my txt 6 lines to go from 50 to 80 frames, that again to 50 and like this 6 times (e.g. to repeat this segment 6 times)
one 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?
My user is using a colourpicker to select the colour. I then want to use that picked colour to change an objects colour via colour transform. But colourTransform wants an RGB version of the colour.
I need convert 1 number from dec to hex, use array char, 0123456789ABCDEF, don't use toString(16).
[Code].....
This example use Array, I can change my char, this example code convert RGB color from dec to hex, number bigger 255 can't use, convert 1 number as 1297569443 to hex 4D5756A3.
Ok, heres whats going on - I have a CFML Tag that displays a number from my Database. I want to get flash to be able to read this number using embedded HTML. However, I can't find a tutorial in Google I may be searching for the wrong thing.
i have a simple dynamic textbox and want to store the TotalTime-property (= seconds of the video) of my video (flvplayback component) into this textbox. how can this super-easy thing be done?
I want to convert a textbox value to numric value and i use a code like this :var n:Number = Number(myTextbox.text);when i trace the variable (n) it gives me 0. although when i trace myTextbox.text , it gives me the right value.
I am trying to convert an entry using a numeric stepper in flex into words to display in a textarea.i.e a user uses the stepper to enter "89" as a value and in the text area the words "Eighty nine" are displayed.After much searching i haven't found anything that helps - a few javascript functions but that is all.
I'm doing a simple hex converter with a input window(hex) and output window(dec)
Currently i'm using a simple script on a button to covert the hex to dec
on (release) { outputBox = parseInt(inputBox, 16); }
This is ok if you want to convert one hex number at a time, what i want to do is input lots of hex values (in the input window) and convert them to dec (to the output window) in one go.
I am using the following code to create an array of grid coordinates. After pulling my hair out for quite some time, I did a trace (typeof) and found out that the coordinates are going into the array as objects. Obviously, I need numbers. Does anyone know how to convert the array values to numbers instead of objects? (as you can see, I wrapped my push command with the Number() operator, but it still turns out to be objects!)
for example: private var myTextBox:TextField = new TextField(); private var myText:String = "Type here"; ..... ..... var position = int(myTextBox.text);
If the input value is "1" then it's ok. But if the input value is "-1" then I don't get the negative number. It just outputs "1"
I am using the following code to create an array of grid coordinates. After pulling my hair out for quite some time, I did a trace (typeof) and found out that the coordinates are going into the array as objects. Obviously, I need numbers. Does anyone know how to convert the array values to numbers instead of objects? [code]...
I want to store textfield data in a variable, the textfield will only contain "red, "blue" etc, and convert these strings into their hex values and then use that variable in beginFill method.