ActionScript 2.0 :: Lots Of Dynamic Text On The Fly?
Aug 21, 2003
How would one go about this ?say you have a number of input text fields. and ppl feed their orders in.
big mac = 5
mc chicken = 2
lg coke = 0
fillet of fish = 0
cookies = 0
sunday = 2
then once they are done it shows thier order..... without all the menu items.
big mac = 5
mc chicken = 2
sunday = 2
To do this I was going to attempt to have an if statement for each item.if there was an item ordered a dynamic text box would be created at _x _y...... then add 10 to _x. (to move the next one down the stage)
if there was no item ordered a dynamic text box would not created.then the next item would be created further down the page as _x was increased with the last menu item created.
View 7 Replies
Similar Posts:
Nov 20, 2010
I have made a for loop that makes lots of squares by making a fresh graphics object for each square:[code]Is there a better way to do it as this seems to cause massive slowdown as the game gets larger.Like if I use something from the library, I can just reuse it without making it every time (like = new telephone() ).Its like it reuses the image in each instance of the object.But is it possible to reuse in this way with shapes?
View 3 Replies
Apr 25, 2008
I've recently created a Super Text Transition class - its pretty much perfect, except theres on thing that niggles me.
It works by splitting up dynamic textfields into many movie clips, one for each letter - but I cant work out how to position the newly created letter movie clips (each containing a dynamic textfield with only one letter in them) in the right way so it looks exactly like the original text would in the textfield.
Im assuming Im not taking into account certain variables - between textWidth/textHeight, _width and _height of the letter movie clips, leading, letterSpacing blablabla. know the variables to use to recreate a text field with lots of letter mcs?
View 2 Replies
Jun 8, 2009
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??
View 4 Replies
Oct 14, 2011
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]....
View 2 Replies
Apr 14, 2011
I have around 400 sounds in my flash file.Is there anyway to go about using them with having to instantiate them all.I will be storing them in an array.
var sound1:Sound = snd1;
var soundN:Sound = sndn;
var mySounds:Array =[sound1,soundN....];
I already have linkages in the library as sound1,soundN,etc
View 1 Replies
Aug 11, 2009
Is there a way to make many movieclips change the same way, off the same line of code.. rather than having to write them all out seperatly?
eg.
If this was the original code...
clip1_mc.onRollOver = function () {
clip2_mc._visible = false;
clip3_mc._visible = false;
[Code]....
The above doesn't work... but i'm wondering if anyone knows of a method that will work... saving me from having to write so much code in future?
View 3 Replies
May 14, 2010
I'm a game developer and I have been (trying) to optimize an engine I'm making for my game. So far I have done almost every code trick there is (almost, because I'm not even close to be a professional programmer so I don't know how to do this perfectly )The game is working very smoothly now, I'm impressed, but its still generating some issues with MovieClips. When I load a new map, it loads up a movieclip that contains all the ingame objects (Screen). Inside, I add all the enemies, player and map elements I need. After that, I sort the index of the objects inside it by their position on Y.
While this works fine (using vector), my problem is that each map has like 30-40 movieclips (like doors, walls, etc), plus the player (another movieclip), plus some objects (20-30 movieclips), plus some enemies (10-40) movieclips... and when I move the camera (following the player), all the flash window area needs to refresh, and generates lag. If I only have the doors, walls and player, it runs ok... but when I start adding the enemies and other objects... Is there any efficient way to work with movieclips? Notice 90% of map elements like doors and walls are a movieclip with only one frame.
View 1 Replies
Jan 8, 2007
Only recently have I understood that onEnterFrame creates a continuously-running program that runs at the same framerate as the movie (until you call a "delete enterFrame). So, if I have a bunch of these running at the same time will I see a big speed drop? I'm a bit leery about using onEnterFrame because of this. Are there any alternatives to this method? I haven't been able to find any (short of putting onClipEvent handlers on movie clips).
View 5 Replies
Apr 23, 2010
I am using FlashDevelop and Flex SDK, I use this to embed things on the swf:[code]Now, I would like to embed more than 100 files (or maybe more!), and doing this one bye one will take long and will be very exhausting Is there any easy way to that easily?
View 1 Replies
Jul 22, 2010
We have made a simple button class that extends MovieClip, the purpose of which is to allow animated switching between lots of states. So far so good. Then we extended the simple button again to allow for a text field and resizing hit area. Still all good. Finally we extend our label button into an application specific type that alters the button's background image in a certain way. Everything seems pretty simple, right?
Now for the problem: it doesn't perform any gotoAndPlay actions.It should be jumping to labeled frames, the traces of the target labels come out correct, but the playhead never moves. Looking at the application using De Monster, it seems that each instance of the button is missing all the properties and methods of a MovieClip.I realise that this is all a bit vague without showing any code,what might cause the debugger to report a lack of properties or why gotoAndPlay might be blocked
View 5 Replies
Jan 8, 2010
I'm having a hell of a time optimizing my loading sequence for a gallery site I'm working on. This is the way it works:
1. I load and parse an XML containing the URLs to the thumbs and large versions of the photos. - This step is fast and works the way I want.
2. I load the thumbnails in sequence jumping back and forth between two functions - one initiating loading of a thumb, and the other the event handler for that particular thumb which iterates a value, and then calls the initiating function again. I suspect this is where the major slow down happens.
3. When the iterating value has reached the same number as the number of URLs to load, the class dispatches a complete event, and all is well - except so much time has passed that no one will ever have waited to see the content ...
[Code]...
View 7 Replies
Apr 18, 2010
I'm trying to get the program to generate a library object called "Enemy" on the screen when the conditions are met.
Here's the bit of the code which is causing me problems:
Code:
var army:Array;
var enemy:Enemy;
function AvoiderGame()
{
[Code].....
I'm sure it must be a simple error, I can get the logic working when it just traces something on the screen but i can't get it to generate an "enemy"
View 4 Replies
Apr 16, 2011
I'm doing an AS2 project with a parent.swf that loads many child_##.swf's. they each use identical buttons and other library assets.tried using Shared Library concept two different ways:
1 - created library.swf and used assets from it for child swf's ... no problem when child is played by itself, but when parent loads the child's, shared assets do not work,
2- established parent.swf as the 'library', and followed the common steps of Shared Library setup, but shared assets did not work. of course, using class files works, but still I need a central place for the graphics ( I'm avoiding having my classes create graphics via draw methods ).
View 1 Replies
Aug 24, 2009
I hired flash developer to make me fisheye menu with a lot of rows and columns, be he just can't make it, he says that it stuck and that it is slow when he tries to make a lots of rows and columns, is there any component in flash that could work with to make that.
View 2 Replies
Oct 19, 2010
I am running into trouble with a multidimensional array. This works well with up to about 2000 "sets"
var datasets:Array = new Array(
// one "set"
new Array(
[code]......
View 4 Replies
Aug 19, 2011
I want to create an array of loaded xml for the following:
ActionScript Code:
var xmlQuestions:XML = new XML();
System.useCodepage = true;
[Code].....
What I want to achieve is so I can load 5 different xmls and place them into an array. All 5 random xmls will be placed in an array then I wish to trace them
View 3 Replies
Jun 7, 2011
How can I assign the same function to lots of different buttons with different instances names? ie the following function needs to be assigned to all my "correct" buttons. ie, correctansnwer1, correctanswer2, etc etc.
Code: Select allObject(this).mainquestions.CorrectAnswer1.addEventListener(MouseEvent.CLICK,correct);
function correct (event:MouseEvent):void
{
[code]...
View 1 Replies
Jul 20, 2011
i created a game that has 96 still movieclips and seven more movieclips that basically move horizontally. The lag starts to rise if i add more and more moving movieclips. The game loop just basically, increment the x coordinate of the movieclips, so i don't think i have problems in the game loop.Is it normal the flash will lag once it has exceeded certain number of movieclips??if it's normal, what do you suggest to increase the game's performance?anyway, this is the update method from the game loop:
public function update():void
{
//cek kondisi untuk melakukan spawn char
[code].....
View 2 Replies
Mar 5, 2011
I need to add things to the stage and later they get removed, my first flash had a problem because when I removed things from the screen their click handeler didn't get removed, and was slowing the program down.So I've been trying to figure out the best way of making a thing and assigning a click handeler to it that I can remove later.
I've written this as a test piece of code .This basicaly makes 20 circles and adds a click handeler to each that knows which circles been clicked but it dosn't work.The error I get is
TypeError: Error #1006: value is not a function.
at test_fla::MainTimeline/addClicks()
at test_fla::MainTimeline/frame1()[code]......
View 1 Replies
Apr 11, 2007
i've been batteling with this for over a week now and i've just been unsucessful. I wonder if someone has got a better solution/theory to solve my problem I am trying to make an online product selection in flash. So the user goes from stage 1 to 6 choosing different options.
The first stage is where they choose the material. I have over 100 different materials to display! I want to put them in a database so i can update it later and also apply filters on the display page, because each thumbnail needs to store the Picture url for thumnail and main picture, the name of the material, the Price range code, the Colour description, pattern description and the material description.
How can i achieve this?! I really have looked high and low for something that stores it on one page and filters can be applied. It just needs to fill a movie clip with as many thumbnails as it finds in the DB, whilst storing the information for each thumbnail. Eventually i would like to add a button below each thumbnail which says 'select this one' which then just sets a variable to the name of the thumnail button they clicked.
View 6 Replies
Apr 18, 2010
I've managed to get a sensor attached to an arduino talking to flash using something called AS3glue. it works, when i set up a trace("leaf") for the contition that the sensor reads 0, i get a printout of the word "leaf". however i want the program to make a graphic appear on the screen when this condition is met, not just trace something.
I'm trying to get the program to generate a library object called "Enemy" on the screen at a random position each time the conditions are met. It's called enemy because I was following a game tutorial...actually it's a drawing of a leaf. Here's the bit of the code which is causing me problems:
[Cdoe]...
View 2 Replies
Feb 26, 2005
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 Replies
Jan 28, 2004
I'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 Replies
Jan 28, 2004
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.
View 3 Replies
Apr 24, 2010
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.
View 1 Replies
Nov 28, 2006
If you take a look at my flash movie you will see that I have draggable movie clips, which contain dynamic text fields. These text fields contain text drawn in from a simple xml document. The problem I have is that the text in the text fields is hedged right next to the border of the autosized text box. This makes them look untidy and in the worst case difficult to read. I wonder how I can add some margin to the left and right of the text to fill in some space.The code which formats the text boxes is:
with (main["dragAct"+i].dragActText) {
text = actText[i+1];
background = true;
[code]....
View 2 Replies
Jan 27, 2009
I have 4 dynamic text boxes which duplicates the text from a main input text box. How do I write a code to make visible only the dynamic text box I want when clicked it's check box.What is the CODE to make each "DYNAMIC TEXTBOX" visible when clicked on it's checkbox?
View 6 Replies
May 13, 2011
I have a dynamic text on the stage which gets updated (shows numbers) when some buttons are pressed.I just need to know if it is possible to show the first dynamic textfield in another dynamic textfield.Lets say the first dynamic textfield called "price" and the second one called "price2". when a button is pressed, the first dynamic textfield "price" will show a number. is it possible to show whatever is shown in the "price" in "price2" ?
View 1 Replies
Dec 8, 2010
I'm creating an XML-driven pie chart in AS3 with 2 text boxes in each pie slice. Both text fields are dynamic in the sense that they are populated by the XML doc and then told where to place themselves in the AS3. I've got them both using the same x and y position to place themselves at the moment (which of course puts them right one top of each other), but I'd like to make one of the fields (which acts like a label or a title to the larger number and % text field) place itself in a particular spot around the other text field. The result I'm looking for is to have the smaller "title" text field appear approximately 5 pixels above and left-justified to the larger "percentage" field.
Anyway, here are two sections of code that I've currently got. The first chunk, for the Tags portion, sets the position for the "percentage" text field using a good old x and y method. The second chunk, for Titles, is setting the position for the smaller "title" text.
//evaluate tags
private function evaluateTags():void{
for (s=0; s
[Code]....
View 1 Replies