ActionScript 2.0 :: Adds 10 To A Dynamic Text Box?
Aug 17, 2009I need a code that adds 10 to a dynamic text box?
View 8 RepliesI need a code that adds 10 to a dynamic text box?
View 8 RepliesWhen the user hits enter, their input is to be compared to an existing input, then stored if there is no match. The problem is, the file is storing the "enter" key as well, so the database input looks like this:
word/r
instead of just
word
Code:
//user presses enter to enter their tag
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkTag);
function checkTag(evt:KeyboardEvent):void {
[Code].....
Dyamic text box timer problem?
var score:int=0;score += 10;
addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void{ mytextbox.text = String(score);}
on first click it adds number 10 then it doesnt goto 20 on the next clicks?
i have a problem with the line space flash creates when a dynamic text is loaded in a dynamic text field on the stage i put a dynamic textFild with istance name "profile_text". then im loadin in it a text. my text is written in the Notepad like this
[Code]...
i already set a Textformat to my dynamic text with i tryied to play with the "Leading".. but i think it something dealing with paragraph. how i can decrease spacing between paragraphs??
All I want to do is add text from my string to dynamic text field when I click dynamic buttons. What should the as code be for this? Here is my code. Right now I just have the click returning another shape.
[Code]....
I have this code, which should work fine, but it doesn't.
Unit1_Mobs_Destroyed += 1;
Text="Unit 1 destroyed "+Unit1_Mobs_Destroyed+" Mobs!" It should set Unit1_Mobs_Destroyed to current value + 1 If Unit1_Mobs_Destroyed is 5 at the start, it should be this: Unit 1 destroyed 6 Mobs But that doesn't happen instead I get this: Unit 1 destroyed 5 1 Mobs
i have successfully created a loop that adds 100 movieclips to the screen but my problem is that they all appear on the screen at the same time. what is the best way to make the movieclips appear within a few seconds of each other?
ActionScript Code:
for (var i:Number=1; i<=100; i++) {
var circle:MovieClip = new ball();
addChild(circle);
circle.x=Math.random()*stage.stageHeight;
circle.y=Math.random()*stage.stageWidth;
}
I'm having a problem with extra lines being added to my text anytime the stylesheet is applied??
Here's the actionscript:
this.createTextField("bodytxt", 0, 50, 30, 430, 200);
bodytxt.html = true;
bodytxt.border = true;
[Code].....
I have two buttons one that adds 2 and one that adds 3.
Code:
score.text = 0;
add2.onPress = function():Void {
score.text = Number(score.text) + 2;[code]....
I want to gotoAndPlay to another frame with the value adds to 5. Say if I press the add2 button and the add3 button, I want to go to another frame.I tried making score.text a variable and it didn't work.
If (score.text =5){
gotoAndPlay(1);
}
Due to my need to tween TextFields, Flash managed to botch up simple scale Tweening.Right now, the font is embedded, and it's doubling the total SWF size.I want to be able to tween the size of the TextFields, without that "jerky" motion. Some way to convert it to vector graphics would likely be the best option.I tried rendering as a bitmap, but it isn't getting the desired result, and the hit areas of the TextFields seem way off. Also, it tends to blur quite a bit, even though the scale is only 1.2.
View 12 Repliesi am working on this code
[as]portfolio_btn.addEventListener(MouseEvent.CLICK, portfolio);
home_btn.addEventListener(MouseEvent.CLICK, home);
var loader:Loader=new Loader();
loader.load(new URLRequest("portfolio.swf"));
[code]....
so i can click on a button and after 2 seconds my swf loads fine. but then when i click on the other button to unload, remove it. It plays again...how can i remove it so it doesnt keep adding itself.
As far as I know theres in no way to cahnge the alpha of a dynamic text box. I put one in a movie clip and when i try to change the alpha of it everything else in it changes its alpha but the not the DT box. Could someone plz verify for me that u can't change alpha and help me find a component that allows alpha control with a dynamic text box. thx in advance.
View 5 RepliesI'm relatively new to Actionscript, in fact, I just figured out today how to load text from an external source. I have another issue that I'm not sure how to handle. I have buttons for my main nav, a main text box, and a mini text box (both text boxes are loaded dynamically from external files). I want to have the mini text box load new external text files in the main text box. For instance, I have a button for music, which loads a list of songs in the mini text box. I want to be able to click on the name of one of the songs and have it load the lyrics in the main text box. I'm sure it's simple, I'm just new.
View 3 RepliesI have another issue that I'm not sure how to handle. I have buttons for my main nav, a main text box, and a mini text box (both text boxes are loaded dynamically from external files). I want to have the mini text box load new external text files in the main text box. For instance, I have a button for music, which loads a list of songs in the mini text box. I want to be able to click on the name of one of the songs and have it load the lyrics in the main text box.
View 3 Repliesi can use flash a bit. can any one point me in the right direction of making a add like this [URL] the 3 picture one
View 1 RepliesI'm rather belatedly getting to grips with the new tweening system introduced in CS4. To be quite honest it's been a nightmare, but I'm starting to see its good points now.One thing that still drives me crazy is when you create a new tween and Flash creates a new layer for you and puts the tween into it. Why? And how do I stop it? Over the course of a 10 min animation with a lot of tweens I could end up with hundreds of layers
View 2 RepliesI'm trying to create a button that, when first clicked, will add a MC to the stage. Then, on the second and subsequent clicks will remove the existing MC and replace it with a new one. The code I'm using is:
stop();
draw1.buttonMode = true;
draw1.useHandCursor = true;
[Code]....
Is there a better way to handle this than what I have above?
I have two classes, both in the same package, one of which parses xml and adds a value to the second via an internal set method. This initially works fine but as soon as add a public get method to the second class I get an error (1059: Property is read-only).
The problem goes away if I make both methods public or internal but in this situation I would like to have one of each. Is this possible? I thought I had done this in the past without any problems but maybe not.
I am trying to track the exit clicks of the users in the adds in my page.
Can I somehow capture with Javascript the click event of a user in a external Flash add I have inserted in my page?
I have been searching and trying by myself, but it seems like the flash object inside of my page is a black box, where I could not access anyway.
I'm using to bitmapFill to add tile grid to a movieclip which contains an image and it's adding a white fill in the transparency parts of the movieclip even if I set the transparency true, here's the code snippet I'm using.
ActionScript Code:
var mySprite:Sprite = new Sprite();
var myBitmap:BitmapData = new BitmapData(2, 2, true);[code]......
A friend was asked to create a calculator which adds several variables together and produces an output which has other pre-determined variables added or subtracted...[code]The problem now is that the people that asked for it forgot to say they needed a further calculation which between us we just can't work out! Basically, if net_estate is under 285000, then tax_liability is to be 0. but if it's over 285000 then tax_liability = 40 / 100 * net_estate (as in the above code).
View 2 RepliesHow do I create an fla that rotates banners made in flash (external flash animations) upon refresh on the browser?
View 5 RepliesI have a class that adds to the main stage fine, but not inside an MC
var SliderTestClass = new SliderTestClass;
mContent01.addChild(issSlider); //trace says undefined
addChild(issSlider);//trace says [object SliderTestClass]
Why would it refused to be added to mContent01 which is a visible MC on the stage?
I can find my way in Actionscript 2.0, but 3.0's hell for me. I've been following a bunch of tutorials and I suppose I understand the 'basics', although I'm beating myself over this 'cause most of you will probably consider this basic aswell.
The problem at hand : I made a few movieclips, that have a transparant button on the first frame inside of them, and on layers below it an animation that starts once you click it, then stops at the last frame.
(Example : You see a snail, you click it(but really click the transparant button that's above it) and the movieclip starts playing, showing a snail that crawls back inside it's shell, then it stops. Pretty simple, but it's a fun and easy way to have multiple interactive graphics on a page.)
The task at hand : Somehow make a score system that allows you to see how many of them you've clicked, meaning everytime you click a snail (for this example, anyway) there's a +1 function somewhere.
Currently, inside the movieclip (the transparant button) I have :
stop();
alpha_btn.addEventListener(MouseEvent.CLICK, nextClick);
function nextClick(event:MouseEvent):void{
gotoAndPlay(2);
}
Which is pretty straight forward. alpha_btn is the button that makes the animation inside the movieclip play. At frame 30, there's a stop(); function.Then, there's the main timeline.
function scorePoints(myPoints:Number):void {
if (Number(scoreBoard.text)) {
scoreBoard.text = String(myPoints);
[code]...
It works, but only once. After the snail is clicked, I have it looped (no stop(); at the end of the moveclip, but it moves to the first frame again. Meaning, the button's there again and it's clickable again.) but everytime I click it after that, there's no points added to it.So I'll break it down to this : I need simple button that, when clicked, adds a number of points to the scoreBoard.
Problem: I am trying to get a very simple text resize going, for my main content area in a flash website. My aim is to get a button, that on click, increases the text size of a dynamic text field.
[Code]....
This is what I tried, I am very new to Action Script, so excuse the futility of my code.
I have a flash that I took out of a template to customize. (I'm using CS4). Same size, hell mostly the same file with small changes. None of the changes were to the file height or width.I have looked all over the code, checked all my spacing/padding/etc, and went line by line through the code and it's identical...I preview it in IE and it's fine. Everything matches. I preview it in FF, and there is about a 10-15px gap b/t the header and the body. I am at the end of my rope! The rest of the site is just about ready to go live, and I can't do that until I figure this out.
View 3 RepliesI'm wondering if there is a better way to approach this than my current solution...
I have a list of items, I then retrieve another list of items. I need to compare the two lists and come up with a list of items that are existing (for update), a list that are not existing in the new list (for removal) and a list of items that are not existing in the old list (for adding).
Here is what I'm doing now - basically creating a lookup object for testing if an item exists.
[Code]...
I've created a wrapper around Sprite called ClickableCircle, which is meant to add itself to the display list when instantiated. Here's a toy version:
public class ClickableCircle extends Sprite {
protected var circle:Shape;
protected var myName:String;
[code].....
I have a Flex/CF app that sits on 2 redundant servers behind a load balancer. Both the Flex and CF side make calls to the same CFC. The Flex, CF and CFC are all in the same folder. When the CF code calls the CFC, there's not a problem. However, when the Flex code calls the CFC, it adds an explicit port "84" to the URL.This causes a problem for the load balancer which only accepts traffic from port 80. As I understand it, the load balancer would internally route requests from port 80 to 1 of the 2 servers on port 84 (but that internal routing should be invisible to the client).
[Code]...
I currently have a button that triggers an event merging the movieclips on stage into one sprite, and passing it to a printer class. The printer class looks as follows:
ActionScript Code:
public class Printer {
private static var printJob:PrintJob = new PrintJob();
private static var printJobOptions:PrintJobOptions = new PrintJobOptions();
[Code]....
The problem is that when clicking the button, the stage gets a white rectangle in the upper left corner that can't be removed!