ActionScript 2.0 :: Math - Set Dynamatic-textfield Rightwrong To Wrong?
Nov 17, 2004
I have tryed to make a math program, but cant get it going as i want with my knowlegde in flash as.This is what i want to do: What is "random number1(random is max 20)" x "random number2(random is max 20)"
Answer 1: "random number1*random number2"
Answer 2: "random(random is max 20)*random(random is max 20)"
Answer 3: "random(random is max 20)*random(random is max 20)"
If Answer 1 is clicked, then do:
set dynamatic-textfield rightwrong to right
If Answer 2 or 3 is clicked, then do: set dynamatic-textfield rightwrong to wrong.The right answer do i want to be different each time too.
Set variable as numbers var monthly_num:Number = 0; var ttl_num:Number = 0; var ttl_rev_num:Number = 0; // user-entered numbers from an Input textfields monthly_num = monthly_txt.text; ttl_num = ttl_txt.text; // Multiply two user-entered number together to get new result ttl_rev_num = ttl_num*monthly_num;
Attempts to assign numbers typed into textfields to numeric variables causes errors. 1067: Implicit coercion of a value of type String to an unrelated type Number.
I have a text caption (two textFields, one acting as a dimmable background and the second including the displayed text) that when added to the stage takes on the default alpha value (1) and is not changed when I address it in mouse_over and mouse_out events.Some background... What I want to accomplish is:
1) a horizontally scrolling image gallery 2) reads image source, caption title, link and page data from an XML file, 3) is re-usable on several web pages (both swf and xml) as it can identify the current page and dynamically display images appropriate to that page from the xml file 4) On image mouse over the image should resize (get bigger) and should pop up the text caption for the image (this is where I am stuck!!!) 5) on image click should take the visitor to a new url
I have cobbled this together from several tutorials and am not a developer.I sense I have gone terribly, terribly wrong with the textField stuff if not with other things too.The caption pops up on the stage at the bottom of the image (where it should be) at run time but at full alpha (1) even though I set it to 0 earlier.I suspect this means I am not loading these objects correctly (but I don't know where I've gone wrong).Then inside the MOUSE_OVER and MOUSE_OUT events I can't change the opacity attribute which makes me suspect I am not addressing these objects correctly (but I don't know where I have gone wrong here either).[code]
var p:int = 0; var n:Number = 0; n = 32.999999999999999; p = Math.floor(n); trace(p); // returns 33 n = 32.11111111111111; p = Math.floor(n); trace(p); // returns 32
I would expect both of these to return 32. I have searched, and it seems this is an unreported bug in AS3. Or ... am I doing something wrong?
I have a code in which I have to use Math.round if a certain value is for example 3.67 (67 is higher than 50) and Math.ceil if a value is for example 3.23 (23 is lower than 50). What can I do to make flash calculate if what after the dot �.� in 3.23 (for example) is higher than 50?
or some variation thereof. I understand that the function first finds the maximum value of two values then turns around and uses that to find the minimum between two values.why this is done? And how do you know when to use it?
So here is a piece of code that I have seen used a lot but don't really quite understand:[code]or some variation thereof. I understand that the function first finds the maximum value of two values then turns around and uses that to find the minimum between two values.And how do you know when to use it?
I'm making a flash company profile in the style of a website, except it won't be uploaded online.and i made each button skip to a frame that i already named
some of the buttons are skipping to the wrong frames for some reason,the ones that are not working properly have some pretty big picture files on them,could this be the reason or is it just an action script mistake?
I did a banner in flash CS3. I did 8 things and you see them one after the other one. The first time that it plays it goes on the right order but after it finished, when it normally has to start playing again, it plays in wrong order (the first then the third, the last, the second again the first, last and so on), it just does what he wants and not what I did.
I have built a website that contains two flash galleries on two separate pages.Each .swf galllery is meant to call a separate xml, loading the relevant text and images.The galleries work perfect when using Firefox-windows, Firefox-mac and Safari and on my local machine(macbook)The galleries do not work using IE-windows, the problem being it loads both galleries with the same xml. [URL]
how can i make a movieclip and a textfield to resize to the content of the text in the textfield? I mean, if I have a textfield with 3 letters font name XXX and then the content of the field change, how can i resize te textfield so the text dont autoadjust to the 3 letter space?
Does anyone know, why a textfield may become white when loading text + JPGs into it? Sometimes it happens to me, sometimes not. I haven't figured out why. If you have any clues... The AS I'm using:
I am looking to change the background color of a input textField when the user selects that testfield to start populating it. I have done a bunch of searching and I keep coming up with this type of answer...
Code: myTextField.onSetFocus = Set(evt:Event){ // Change color }
Problems...
1) Is onSetFocus/onKillFocus still available? From what I can tell it is not.
2) I have my text objects encapsulasted in a class so I do not believe I am able to do it like I have been suggested.
I'm using the following to remove a textFeild from the stage I then need to add this textField back to the stage at a later time....i tried using addChild the problem is the text that was in the text field prior to the removal is still in the textfield when i re add it......How do i remove the textfield and replace it with a fresh textfield at a later time?....using msgTa.text =""; is not an option.
I just recently started playing with cs5 and it's new features. I tried to rotate a textfield with the 3D rotation tool, but when you do this, the textfields gets blurry.And it seems like it's not a vector text anymore, because when you zoom in, it still is blurry.Is there a way to prevent that?
i would just like to ask why is the case that when i use embedfonts = true on a textfield, the textfield's text only resizes according to the textfield's height but not the textfield's width. meaning if i make the textfield's height bigger, the text also gets bigger in terms of height, but not width, can't the embedded font maintain aspect ratio according to the textfield height?
I'm only wondering about this because this is not the case when embedfonts= false
I have an AS2 flash movie that has some labeled frames. On the first frame of a particular scene, I have some code that creates a menu of buttons that I construct from movie clips and vector graphics. The onRelease function of those buttons is assigned deep in some code thusly:
When one of these buttons is clicked, the scene name reports correctly, but the movie goes to a frame 3 frames later than the targeted frame. I know this because I put trace actions on the subsequent frames like this: code: trace('2 after');
Now, when I click on the button in the area where the movieclip is it will register this movieclip as event.target. I would like to make the button the event.target regardless where I click and prevent flash from registering the movieclip inside the button as the target.
What I have done is create a new actionscript 3 document, imported to stage my bitmap then converting it to movie clip, then i just apply the 3d spin motion preset.When i try the movie it spins ok apart from 1 frame where it looks like the bitmap moves to the left slightly.Do I need to delete frame 1 or the last frame perhaps
This is a bit of an odd-ball problem. I've created a website 524 frames long, but am creating the pre-load bar *after* the website is done. I could move all the frames a few over, but this would require remapping all my many, many buttons. What I've done then, is told Frame 1 to go to Frame 525, and put the preloader there. I should note the site works perfectly without the pre-loader, I just want it to be smooth once it makes it online.The following code is being used for the first frame (frame 525) of the pre-loader: