I would like to make a dynamic field where the number to make a count of 0 to a number that will come from a variable.I am researching several hours and can not find.An example is the preloader, we have the percentage below the bar that has that type of field, plus the preloader I have is based on getBytesTotal (), and getBytesLoaded ();But in my case I'll just have a variable with the final value, and I want to show that the field from 0 to this value.
I'm trying to figure out Flash CS5 on my own, and this should be easy, but... All I want to do is validate that the text entered in a text field is a number when a button is clicked. It can be a positive, negative, or decimal, but no letters or symbols.
i have a dynamic text field on the stage with the instance name of "inputBox". On the same frame i have the following code...
ActionScript Code: var firstNumber:Number = 3; var secondNumber:Number = 5;
[code]....
the above code works perfectly and it does trace back the result. However I'm confused on how i can put the result in the dynamic text field i have on stage. Can i use the instance name to do this...
I am creating a dynamic text field and "next" button. When the movie is played, the number "1" will be displayed on dynamic text field. When the "next" button is pressed, the dynamic text field will display 2 and so on...
I'm writing a scrolling shooter game and have a dynamic text field that holds the game score. Running inside an ENTER_FRAME event listener, it updates every frame. By tracing the variable "score" I get the correct numbers showing up in the output tab, but on screen, I only see the number 2. It doesn't matter what position in the number it is (ie: 20, or 10372, or 521), only that digit will show up. If there is no number 2 in the score, the field only shows the word "Score: "
The variable is declared as such:
var score:int = 0;
The text field is called scoreCard and is set to "Classic Text" and Dynamic Text" and it is 638 pixles wide (almost the entire width of the stage).
Here is the code for updating the scoreCard:
scoreCard.text = 'Score: ' + score; trace(score);
The trace was simply put in to see if the score was being tallied up correctly, which it is.
I have also tried eliminating 'Score: ' and simply used:
I have the need to populate three text fields with a random number in each.How do i wire up each field to retrieve the results of the random number function I've written in Actionscript?
I'm working with an input text field that has to contain a max number of characters (90... I set this on the properties panel) and a max number of lines: 6 but i don't know how to set this property.... I've searched, and all I could find was the numLines property, but it doesn't allow to specify the number of lines iI need my text to have...
On my stage I have a dynamic text field (instance name = lives).
In my actionscript I have created a number variable called livesnum. And then beneath that I'm setting the textfields value to be the livesnum variable but I get the following error:
1067: Implicit coercion of a value of type Number to an unrelated type String.
My actionscript is as follows :
var livesnum:Number = 4; //Amount of lives lives.text = livesnum;
How would I achieve setting the textfield as the numeric value of the variable?
I'm starting my progression from AS2 to AS3 and am running into a glitch that has me tugging at my hair.I'm basically trying to create a button that will generate a random number and place it into a text field. However, when I try to run the script as shown, It hits me with a 1067 Implicit Coercion error message.However, if I run the currently commented out String variable test it works fine but when I try to to run the Number variable code it errors out on me.The random number generation code is working (based on the trace) but for some reason won't show up in the text field (named myText).[code]
Why does Flex 3 DataGrid read a string from XML lastResult.node as number?A field is saved as var_char in mysql, php reads it as string and pass it OK.If there are more then 16 charaters it gets rounded....For example:
this in database cell:
12345678901234567
gets read in DataGrid as nubmer as 12345678901234568
this is in database cell:
5555544444222223333377777
php reads it same and puts it in XML flex reads XML into arrayCollection and DataGrid reads it as:
5.55554444422222e+24
So it reads it as number, why? And how to make it read as String? I tried with labelFunction, no help.
is there any way to increment a display number up or down my clicking / holding a button?
im making a project to select a fuel tank capacity and want the default to be 0.0 gallons and have the user increase the number or decrease the number by clicking and up or down arrow button... If they hold the same button that function would ideally increment faster, perhaps by multiples of ten until it reached a max / min number.
I do not want to have it scroll. For example if the field has four lines and the user is writing the fourth line, and give such ENTER or continue typing until no longer fit on this line, I do not want to be created in the fifth line text field. It has to do it?
I've tried the following code to check if a dynamic text field has a number or string in it. My problem is that after adding the new if statement (first one) it's the only one that will execute so I don't even know if it's checking whether it's a number or not.
How would I code this so that when entering a number 1-10 in the text field the MC on the stage will go to that frame? Ie if I enter a 9 the MC playhead will gotoandstop on frame 9. I have attached a .zip file to illustrate
I'm trying to do a check to see if the user inputed a number into an input text field. I'm also running a check to see if the user has left the input blank (which works just fine), but I can seem to get the NaN function working.
(using actionscript 2.0 w/ flash CS3)
Quote:
this.btn_step1next.onRelease = function() { if ( zipcode.text == "" || zipcode.text == isNaN() ) { message.text = "Please enter your ZIP code to continue."; } else {
I can't seem to figure out the .numLines property. I've tried calling it on a TextField that was created dynamically. The TextField has multiline set to true and wordWrap also set to true. Any clue why it would consistantly report the number 1? It's being called in a trace statement after the htmlText is set to a string from a xml file.
Does anyone know of a way to restrict a user from entering a number over 100 into a textinput field in flex? i.e. a user can enter any number between and including 0-100 but not 101
I'm trying to get a slider to display a number in a Dynamic text field as it is dragged. I think this is the only time I can say it would be easier in AS3! Sooo, I made the slider and the code to move it, but I cant get the number to pass into it. My trace command fires but I get some static numbers in the text box. I'm just so confused, is it my var, or the math operator, or just syntax?
code as I screwed it up ....
on (press) { startDrag("", false, 0, 0, 200, 0); var xmin : Number = min(0);
I'm using Flash CS5, AS3 to create an .swf that imports an .f4v or .flv that was encoded with Adobe Media Encoder.When I use .flv the video begins playing immediately and downloads progressively. When I use .f4v the video has to download completetly before playing. Considering all things are equal except for encoding the video as either .flv or f4v, what step am I missing that is preventing the .f4v from downloading progressively?
Just trying to load and display a progressive JPEG with AS3. At this stage I do know how to load and display the jpg after it is loaded but I can't figure out how to display it progressively (ie: get something on the screen even before it is fully loaded).
I have a movie where a variable named daysleft will be loaded from an external text file into a dynamic text box, this bit works fine. But I then need the movieclip "numbers" to gotoAndStop to the frame number imported via the variable daysleft. Although daysleft displays on the screen a trace(daysleft); says the variable is undefined.
I'm trying to have a preloader animate according to how much of the external swf has already downloaded on the user's computer. However, several errors like :
1046: Type was not found or was not a compile-time constant: MovieClipLoader.
simple solution to a simple problem. I've made myself a little flv player, using the progressive download method.
However, it only starts playing once the whole flv has been downloaded. Now the adobe docs quote:
While using an ActionScript 3 file, the video begins playing only when enough of it has downloaded so that it can play the FLV file from start to finish. This behavior can be altered using ActionScript. However, I can not find this code anywhere. bufferTime does not work (as it is downloading, not streaming).
I'm trying to decide whether, for my particular application, I would be better off delivering video via streaming or progressive download. Here's the situation: Background: this will be a learning drill for learning foreign language phrases. There will be a series of ten short video clips, each one a headshot of a native speaker, saying a single sentence. The background is static so the only thing changing will be facial expressions, so compression should be pretty effective. Each clip will be approximately 4-6 seconds total length. Resolution will be approximately 360 X 270.
The way this particular drill works makes me wonder if perhaps progressive downloading might make more sense than streaming. But like I said, I'm not a Flash developer, so I could easily be wrong. (Did I mention we're currently looking for a talented, reliable Flash developer?) So here's how it will work: Drill will load up showing written text of instructions, along with audio of the narrator reading the instructions aloud. Approximate length of the audio instructions will be 15 seconds. (I"m thinking progressive download could begin during the reading of the instructions.)
After the instructions have been read, the intructional text goes away and is replaced with (from top to bottom) the text for the first sentence, the video box with a static image of the first frame, a "Begin" button. When the user clicks the "Begin" button, the video begins to play, and the "Begin" button transforms into a "Repeat" button, which is inactive while the video plays. When the video ends, the "Repeat" button becomes active. Clicking the "Repeat Button" causes the same video clip to play a second time (again, the "Repeat" button is inactive while video plays.
Developing a flash resource which runs FLV files from within it as pro gressive. It works ok on my local testing computer/network server. But when I put it online it does not play.I opened up the components panel for each FLV and noticed they were absolutely linked to my network drive (obviously when online this linking will now work). So i changed all the linking to be relative and some warning windows did come up and say i was breaking the link but i ignored them because i don't care about how it runs locally...i want this resource to work online!line.something that it might also be is I am uploading this resource to an LMS called Janisons (perhaps they are not FLV through flash playback - friendly).
Is there any particular path of troubleshooting I could go along? Because I have just about tried everything i know!UPDATE: I changed back one of the FLVs parameters to link to local drive in the component parameters - and as expected, it runs fine locally but when previewd in chrome (which might i add has some great debugging features that you could only dream of finding in IE) i get the following message:
Like the title states my Progressive download never plays. Before I waste your time and mine showing the methods used I rather start off simple.
Are there any reasons an flv might not be allowed to stream? I have followed the methods in every Progressive video tutorial I can find (about 7 so far) and they explain the exact same steps yet my flv never plays. I have also done it entirely with just action scripte and nothing. I get the player and my video list but never get the video. I have the Source set to the web directory of my flv in the parameters in the property inspector.
I have also tried to use this method with other types of video and it also never plays. The only thing that works is embedd it which is of course a terrible only choice.