ActionScript 2.0 :: Adding Unique Dynamic Text Fields To Duplicated Movieclips?
Nov 18, 2005
I'm working on a piece for work. I need to figure out how to add unique dynamic text fields to duplicated movieclips. Unique as in unique instance names and variable names. I have a movieclip on the stage that contains a dynamic text field.
the text field will house text that is being pulled from an xml file.What I need is to have the dynamic text field in all the duplicated movieclips have a unique instance name and variable name.I assume that a nested for loop would be required, but I'm not sure as I am not the greatest actionscripter. Here's what I have so far:
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
[code]....
View 12 Replies
Similar Posts:
Jul 12, 2009
I need to load in xml text to dynamic text fields inside duplicated movieclips. is it possible to do that? I'm using AS 2.0.this is my hierarchy: parent.btns.intNavbar.label_mc.buttText.the attribute name in my xml is menuText.this is my code: (intNavbar is the main movieclip I'm duplicating)
Code:
duplicateMovieClip(_parent.btns.intNavbar, "nav"+num, _parent.btns.getNextHighestDepth());
navRef = _parent.btns["nav"+num];
[code]........
View 2 Replies
Feb 21, 2011
ActionScript Code:
_root.mc.duplicateMovieClip(mc1, 99, {mctext:"this is mc1", _y:200, _x:200})
_root.mc.duplicateMovieClip(mc2, 98, {mctext:"this is mc2",_y:300, _x:300})
This is really drive me crazy! Why won't this work? I have tried
ActionScript Code:
eval(mc1).mctext = "this is mc1"
and it didn't work. I have also tried
ActionScript Code:
_root[mc1].mctext = "this is mc1"
but still it didn't work.
EDIT: I added the file
View 1 Replies
Mar 27, 2005
I am trying to do a bit of code that duplicates a movieclip with an input text box inside it, which the user can then position wherever they want on the stage.
Now, I've been monkeying about with this bit of code (on the frame);
box01.onPress = function() {
var depth = this._parent.getNextHighestDepth();
var init = {};
[Code].....
This works fine for duplicating and positioning the movieclips, but when I try and input text into the duplicated movieclip's input text box, it won't have any of it. I have tried everything I can think of, from trying to isolate the drag, to getting the input text box to position itself dynamically (kinda like a startdrag) but I can't get anything to work!
View 5 Replies
Mar 13, 2011
Adding button with dynamic text fields
I haven't used flash for a while so I'm a bit rusty.
I'm simple trying to add a Button with a dynamic text field and a over state to the button that changes the color of the text.
I want to create a list of nav links and then have an over state on the links.
I have a button in the library with an over state and a text field. The button is exported for Actionscript.
Code:
package{
import flash.display.*;
import flash.events.*;
[Code].....
View 0 Replies
Oct 14, 2009
i have a problem with my flash menu. It's simple menu that contains one MC at start that works as button, u can edit size of the menu from external .txt file by changing the value of menu length. All that works fine , my problem is that every new duplicated mc contains dynamic text area as a label. Labels are also loaded from that .txt file , but that works only for the 1st mc because the newly created text areas in mc's dont have Instance Name set. How can i assign them from as?
View 2 Replies
Apr 1, 2002
Is it possible to load text into a dynamic text field, and if yes how could I do this? I've searched a few tutorials on dynamic text fields but it concentrates on scrolling. I would like unique text to load in the dynamic text field depending on which navigation button I click on.
(i.e. I click on "button1" and "blabla1" text appears in the text field. I click on "button2" and blabla2" text appears in the same text field.)
View 9 Replies
May 15, 2008
I have a form that will require the user to type in some figures (into the input text fields) which will need to be totaled up at the end.
Would it be recommended to execute this function by sending it to php and then back to flash or is there a better way to do it within flash?
Again all I want to do is get the sum of all input text variables (all having number values).
View 3 Replies
Jun 7, 2006
I can't get the code to "know" which of the dynamic thumbnails has been clicked (by "know", I mean return an index value, say 0 through 7 if there are 8 projects, that I can use to access that particular project in the array of 8 projects in the rest of the code)... So if the third movieclip thumbnail were clicked, I'd like "2" to come up somehow... I've tried this code, which is kind of lame, I know, based off of the idea of each of the thumbnail movieclips' names ending in their index number:
Code:
//"this" is the button that was pressed; would return a string ending in
//thumberMC_<number of whichever movieclip thumb was clicked>
var: testString:String = this;
[code]....
Lastly, there's a dynamic textfield I'm trying to create that never shows up for some reason. Again, you could see in the FLA (in the "createDrawer" function around line 424).
View 9 Replies
Feb 16, 2011
I need basically a way to convert a group of selected text in movieclips separately with Flash commands. For example, I know to select just text items in the stage is:
var theSelectionArray = fl.getDocumentDOM().selection;
for(var i = 0; i < theSelectionArray.length; i++){
if(theSelectionArray[i].elementType == "text"){
...
}
}
And I know to convert a selection in a movieclip is:
fl.getDocumentDOM().convertToSymbol("movie clip", theName, "top left");
So I need to know the way to loop over the stage and convert each text field in a movieclip.
View 1 Replies
Jun 23, 2011
I have created a movie clip with the following path to a dynamic text field:
_root.i_lotteryball1.i_ballstrip.i_text.d_text1.text = _global.text1;
I have then duplicated the 'i_lotteryball1' movie clip, and called it 'i_lotteryball2'.When I try:
_root.i_lotteryball2.i_ballstrip.i_text.d_text1.text = _global.text2;
It changes the text in 'i_lotteryball1' text field aswell as 'i_lotteryball2' text field with the value of '_global.text2' How can I update each text field with different values.When I try to change the instance name of the text field inside 'i_lotteryball2' to 'd_text2', it changes the 'i_lotteryball1' text field instance name aswell to 'd_text2'!
My objective:
_root.i_lotteryball1.i_ballstrip.i_text.d_text1.text = _global.text1;
_root.i_lotteryball2.i_ballstrip.i_text.d_text2.text = _global.text1;
View 7 Replies
Dec 16, 2005
Im using this xml "data.xml":
HTML Code:
<XML>
<salesreps>[code]...
I want to generate a mc for each rep with 6 text fields containg the 6 values for eash rep.So for this xml there would be 3 mc's with 6 text fields in each. This is one of my first times really diving in to xml parsing in Flash.
View 3 Replies
Apr 26, 2009
I am trying to construct a MENU with 5 buttons and a dinamyc instance for them (to manipulate later ) so i am having some problems..
// vars
var allButtons:int = 5;
var espacing:Number = 10;
var navBar:MovieClip = new MovieClip();
[code].....
View 3 Replies
Nov 4, 2009
Basically I want to get the text fields in my Flash translated. To achieve this, I have the translations in a XML file and all text fields are dynamic. I read the XML (dependent on a language calling parameter from the HTML) and set the text fields like:
this["text_1"].text = "Hello";
The "text_1" and "Hello" are of course retrieved from the XML and I use variables in my code.
Now to the problem: I can successfully set the text field, that is visible in the Frame 1 (where my script is executed), but setting text fields that appear later give me an error. Translated it means something like Null Pointer not accessible. So I assume, that the this["text_x"] can not be found.
Is there a way to access it without copying the script into each text element? I have also thought about events, e.g. when the text is shown the first time and I do the translation then (would have to cache the XML at startup then to save time), but didn't find anything.
View 5 Replies
Aug 15, 2007
I'm trying to populate a set of dynamic text fields with text using a for() loop and cant seem to get it to work.I have 9 seperate dynamic text boxes each labled picNum0 - picNum8. I want to read a number of pictures from an external file then have those numbers populate 1 through 9 into the text fields.I get the variables loaded in with the correct values but the text fields wont populate.[code]When I trace(curPic) inside the for(){} it outputs: picNum0 - picNum8, so I know that the variables are allocating ok, but dynamic text fields arent populating with the correct numbers.
View 3 Replies
Oct 21, 2007
I've been building a web based order form and my client want the ability to add items (as many as you want) and for them to be totalled up. I've used Kirupas Scrollpane with Dynamic Mc's tutorial to add my products, but I can't seem to add them up! Each product adds up it's subtotal in the dynamically attached Mc and outputs the variable 'subtotal' In my root I have this function to call the subtotals, but I can't seem to get it to add up each of them to output a total...
[Code]...
View 3 Replies
Nov 16, 2009
I have connected to a web service built in java and would now like to add the products to a stage. I want to show 5 products and if a user clicks <- the previous 5 and -> next 5.
Code:
import mx.data.components.WebServiceConnector
// Add preloader here
var wsConn:WebServiceConnector = new WebServiceConnector();
wsConn.addEventListener("result", res);
[Code] .....
In the res function I would like to add my movieclips but I don't know how to move on.
View 1 Replies
Mar 15, 2009
I am wondering how do we determine when a user "starts" entering text into a dynamic text field. Say a person has entered the wrong information and they get an error. I would like to be able to remove that error message as soon as the person selects the input fields again.
View 2 Replies
Sep 29, 2009
I'm trying to make this guessing game where you have to guess how many times a penguin will bounce off the water surface before it sinks The way I'm planning to do it is kind of like this:
1.[Script telling textbox to add +1] >>
2.[Bounce animation] >>
3.[Script that randomly sends you to point 1, or 4] >>
4.[Ending animation]
Yeah, and right now I'm desperately trying to get that dynamic text field to work ...I've made a button with this code:
(The textbox is called "test")
on (release) {
test ++;
}
And on the first frame of the timeline I've added this:
stop();
point = 0;
I've tried changing names, tried adding "_root." (_root.test ...) nothing works!
View 1 Replies
Jun 11, 2007
What I'm doing is that I want to create textfields using flash and insert them into my HTML portfolio site.The reason I'm doing this is to be able to use special fonts, kern the text properly and customize the anti-aliasing. I tried with CSS but I don't have enough control using that (regarding kerning and anti-aliasing).I have created a Flash file that can load specific .txt files into the textfield of the SWF (so that the text becomes formatted), using FlashVars. I discovered that kerning in Flash doesn't apply to dynamic textfields unless you set it using actionscript. So I've tried to use the following code on my textfield:
---
var myFormat:TextFormat = new TextFormat();
myFormat.letterSpacing = 3;
[code]......
View 3 Replies
Mar 6, 2009
I'm populating dynamic text fields within (timeline) animated movieclips. For some reason, this only works with the first movieclip even though the rest are formatted identically. I'm getting no errors.I can load other nodes into this MC so I think the XML and the code targeting the nodes seems fine (tracing the node values works as well).
The problem seems to be with the target movieclips, however I cannot find any differences in their settings compared to the one that is working. AS and XML below:
Code:
function loadXML(loaded) {
if (loaded) {
var format1:TextFormat = new TextFormat();
format1.letterSpacing = -4;
[code]....
I have attached the FLA and XML for reference, version CS4.
View 1 Replies
Nov 11, 2011
i have my black berry being able to add a custom pin i created and when i send a message its shows on the screen but want i need help with is when more thane one persons use it when they text it removes the previous text so i need help in know how to create 4 dynamic text fields so when they text it can transfer to the other three and remove after a period of time..
View 4 Replies
May 5, 2009
I am having trouble embedding a font in my Flash file. I have the font in my library. I have the text field selected to that font with the * next to it. In my actions I have: vid_title_txt.embedFonts = true;
If I set it to false instead, it shows a different font. But if it is set to true, nothing shows.
View 5 Replies
Mar 4, 2010
Is there a way to type HTML directly into a TextField in Flash CS4? I've created a TextField on the stage, set it to dynamic, set "Render text as HTML" and thought that I could then type HTML directly into the TextField and that it would be rendered as such. Instead it displays whatever HTML I type as regular text.
I assume then that the only way to get HTML into one of these fields is to dynamically load it into the TextField through the htmlText property. Is this right? And if so, what exactly is the purpose of having a "Render text as HTML" button in the first place? Couldn't I just load the HTML into the TextField through the htmlText property anyways?
Well, at any rate, I was really hoping to use as much of the flash interface for the project I'm working on, such that anyone who didn't know AS3 could easily update it themselves. Now it's looking like not only will they have to know AS3 and HTML, but also have to deal with the hassle of formatting what will potentially be a complex system of images, textfields, and videos all in AS3 with no visual interface.
Is it too much to ask to be able to just highlight some text and make it bold or italic? That's really all I need, sadly.
View 10 Replies
Jun 11, 2010
I think that I have properly embedded the Verdana font (see image below). However, in my Flash game, dynamic text fields do not show certain letters, such as X and J. What am I missing?
View 8 Replies
Aug 7, 2010
I'm having trouble with dynamic text. I have a symbol with dynamic text fields in it. In the action script file I want to change the text of these text fields like this:
textFieldName.text = "new text";
But nothing happens. I cannot see any text when I play the movie. Also I tried adding a dynamic text field directly to stage and change the text with
textFieldName.text = "new text";
I can see the new text when I play the movie. Then I added my symbol that has the dynamic texts in it, and the text of the text field that is directly on stage disappears. When I delete my symbol, the text is back there. I'm using Flash CS5 and ActionScript 3.0.
View 7 Replies
Feb 2, 2009
i need to use large list of locations in text field round about 5000 to 6000. i have done that but the text field doesnt display data when reaches more than 3000 i think (below it its working fine), i need to cater this prob, maybe it can be done through paging
View 0 Replies
Feb 20, 2009
trying to format some dynamic text fields (i.e.) Im trying to specify the font style, the font size and colour, but my code below doesnt seem to be working, no errors being returned.
ActionScript Code:
private var fontStyle:TextFormat;
fontStyle = new TextFormat("Arial",18,0x006666,false,true);
2. Also trying to specify the physical size of the dynamic text field via code, so that long sentences for example can be fully seen without being cut off, see image below.But Im unsure on how to work out the code for doing this tried the regular googling tatic but no results. my dynamic text fields are added to the stage via addChild(); so just physically changing the size of them on the stage .FLA isnt an option as they arent actually on the stage.
View 2 Replies
Oct 20, 2009
I'm making a program so that you can plug in your birth year and get some basic information on what Chinese year you were born in (Year of the Dragon etc).I created a class, linked it to an MC and looks like it is creating everything okay but the input text is definitely buggy.I can input text at the top of the stage but not in the actual text field.I have spent a lot of time on this and am completely clueless as to what is bugging this thing out.I guess I am not declaring something properly but I've had my TA take a look at it as well and she cannot figure it out. [code]
View 1 Replies
Dec 12, 2011
sa;djkfsajlf;as
View 1 Replies