ActionScript 2.0 :: Dynamic Text Visible Within A Transparent MovieClip?
Nov 18, 2008i have a dynamic text field within my mc. when I change the alpha value of my mc to 0 with script, my text stays visible.
View 1 Repliesi have a dynamic text field within my mc. when I change the alpha value of my mc to 0 with script, my text stays visible.
View 1 RepliesBasically 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.
I am having problems while creating object with actionscript, I am new to it and I am getting some errors. I am creating my object this way
Code:
var myMC:MovieClip = new MovieClip();
myMC.x = 50;
myMC.y = 50;
myMC.name = "hunterToken";
tCursos.addChild(myMC);
And it is created, so far everything's good
Later I try to access the visible property, and I get an error
Code:
tCursos.hunterToken.visible=false;
And I get this error:
Code:
TypeError: Error #1010: A term is undefined and has no properties.
at newSiteHTR_fla::mCursos1_1/go()[newSiteHTR_fla.mCursos1_1::frame1:157]
I'm working with actionscript 3 and have a trouble. I need to write player where users will see text on the front of the movie. The text is text field of type "Dynamic text". The problem is that I need to make this text object transparent for mouse move and clicks.
I tried:
.mouseEnabled=false;
.selectable=false;
when I click on it - it does not pass clicks through it.
I've got a project that loads video clips and text via XML. I'm trying to add buttons but I am not sure how to code them. The problem is, I'm creating 4 transparent buttons over four dynamic text fields. In the XML doc I have 11 different sections or groups of content. Those text fields with the transparent buttons change when each video finishes and a new section is loaded.
What I want to do is get the changing value of any of those 4 buttons that I click while one of the sections is playing and load that new section. At first I thought I'd just check to see what the current section is that's playing and then if I click on the button that represents the next section I would increase the value+1. If I click on the button that's supposed to represent the third section from the current one then I would code the button, current section+3 and so on.
That would work fine but If I'm on section 9 in the XML and there's only 11 sections, I can't add "current section+3" because that would go to section 12 and there isn't a section 12. I would want it to go and load section 0.
[Code]...
I'm having trouble making a textarea with a transparent background, with a visible vertical scroll bar? I've only found ways to make btoh the scroll bar and the textarea background transparent, is it possible to just do this to the background?
View 3 Replieshow to convert text into a bitmap or a mocieclip with transparent background. i could convert the text into bitmap but it has got a white background..
View 1 Replies1) I've created a MovieClip and placed a Dynamic Text into this clip. I've named the text "text_txt";2) I've exported my MovieClip for action script (made it a class) and gave it name "ImageContainer"; And I deleted MovieClip prototype from stage (to create it dynamically later)
3) On main time line in frame 1 I've placed code:
Code:
var clip_mc:ImageContainer = new ImageContainer();
clip_mc.name = "myClip";
addChild(clip_mc);
[Code]...
ADDED: Ha, everything was easy! I should just change one string like this:
Code: MovieClip(getChildByName("myClip")).text_txt.text = "doh";When I placed MovieClip in the beginning everything works fine with Strict Mode! Problem has been solved
I have a scrollbar that uses a movieclip-instance name "text" to display dynamic text.On the main timeline I used the following code:
myLoadVars = new LoadVars();
myLoadVars.onLoad = function() {
dynamictextcontent.htmlText = myLoadVars.dynamictextvariable_html;
[code].....
Let me explain the setup:There is a dynamic text box called, for example, myText stored inside a movieclip that is called myMovieclip. Now, I simply want to change the text of the dynamic text box within the movieclip. Yes I know:PHP Code:
_root.myMovieclip.myText.text = "Hello!";
The problem that I have however, is that the instance name myText is stored in a variable, lets call it myVariable. So in very simple layout, it looks like this:
PHP Code:
myVariable = "myText";
_root.myMovieclip.myVariable.text = "Hello!";
Is there any ways to set a movie clip(item2) invisible but set another movie clip which located inside item2 visible?
View 1 RepliesI have tried making an application with a dragable movie clip inside that there is a dynamic text box. After draging it to a new place, I�m unable to read the value from the dynamic text box. I have tried calling like this "movieclip_name.dynamic_textbox.text". It dnt worked.I have tried with this code also.
event.currentTarget.parent.getChildByName(disp1).t ext
here 'disp1' is the instance of dynamic text box.
I have a game, and in my game I have a dynamic text box which displays the number of points that each click of a fish will give you. I would like to make the points flash in, and do cool stuff. I know that it would need to be a movieclip to do this.
How do I put my dynamic text box in a movieclip, and manipulate it like a movieclip via actionscript. For instance, I would like the points to flash for a second, and then dissapear.
I already have it in a movieclip, but I can't seem to do anything to it with actionscript. It would be an onRelease event, so the event handler would be changing the movieclip.
I'm trying to load dynamic text from within a movie clip....
my actionscript, from within the movieclip, is:
-------------------------------------------------------------------
var content_req:URLRequest = new URLRequest ("What.txt");
var content_ldr:URLLoader = new URLLoader (content_req);
content_ldr.addEventListener(Event.COMPLETE, onComplete);
[Code]....
im pretty sure i need to edit the "content_txt.htmlText=event.target.data;" line since im within a movie clip, and not on the main time line, but the several variations ive tried out aren't working....
also, "What.txt" is the proper name of the text file, and is stored in the same folder as my flash file.
I have a dynamic text filed scrolling with a drag button on a track or the mousewheel. What I am trying to do now is have the scroll button and track not visible if the content is smaller than the text field.
ActionScript Code:
//this if statement not working as should. button and track are always invisible.
//txt is text field name
if (txt.textHeight < txt.height){[code]......
how work with resizing the width of of a movie clip according to the size of dynamic text inside it. I did it by creating a text field 'myText' and then converted it to a MovieClip symbol and named the MovieClip as myClip. The text in myText is assigned at run-time and its width changes according to the text.
I did it as follows:-
myClip.myText.selectable = false;
myClip.mouseChildren = false;
myClip.useHandCursor = true;
myClip.buttonMode = true;
myClip.myText.width = myClip.myText.textWidth + 5;
On doing this I found the clickable area change according to the size of the text field but the text field doesn't appear at all in the swf.
I have a dynamic text field that is loading an external .txt file with html coding in it. I can get the text to load and display properly, however I now want to make a custom scrollbar and I have no clue how to even get it to work.I want to make a custom one instead of using the component one. It doesn't even have to be a traditional scrollbar, I would much rather just use an up and down arrows. In the past I've just used buttons and placed AS directly onto them. However I guess you can't do that in AS3 so I'm lost!
Everything I find online involves converting everything to movieclips, however I can't get the dynamic text to load into a movieclip.The code that is loading the text into the text box is: (I don't know if that will help at all but I'm posting it anyways)
Code:
var loader:URLLoader = new URLLoader (new URLRequest("About_Us.txt"));
loader.addEventListener(Event.COMPLETE, completeHandler);[code].......
I am working on flash & AS file, in flash file (main.fla) dynamic text is inside that movieClip (myButton) .I will like to send some text to that particular dynamic text field inside the movieClip (myButton) from AS file as file code is var myButton:Button; var myText:text; myButton.myText.text="Custom Msg";
View 18 RepliesI'm tryin to build my first button in flash and flex, so I have build my movieclip in flash with a simple animation and a TFL text with instance name 'caption'
I have assigned a class to the symbol and, in flex i wrote this:
package
{
import flash.display.MovieClip;
[Code]....
I start the movie and I see 'HELLO' on my button, WOW! but If I go over the symbol and then out the text change again to 'TEXT' (the default i wrote in flash)
I have been trying to work out for a few days how to access a dynamic text field that is within a movie clip that is within a movie clip.
highScores1>showScores
ShowScores contains 10 dynamic text fields name1, name 2 .... name 5 and scoe 1, score 2 ....score5.
I then attach the movie during runtime using:
_root.attachMovie("highScore1","HighScore1",88);
I can populate and display the scores from a web based database using a PHP script and the following in my flash code:
_root.attachMovie("highScore1","HighScore1",88);
HighScore1._x = 260;
HighScore1._y = 150;
[code]....
What I want to do is be able to access score5 within the movie clip so as to compare against the score of the current game to work out if the player has scored a top 5 score. However, I try I can not access any of the scores within the movieclip.
I have a dynamic text field on stage wich storages a movieclip instance name dynamically. I have a movieClip on stage with an action at the last frame with the code below:
import flash.*;
var CartaSelecionadaA = root.mca.text; //trying to get the text field value
var CartaSelecionadaB = root.mcb.text; //trying to get the text field value
[code].....
I loaded a movie clip and I want to change the text :
Code: Select allpicture.loadMovie(image[0], 1);
on list veriables print out I can see the movie clip
Movie Clip: Target="_level0.picture.instance9"
[code].....
I have a movieclip of instance name "menuBtn". And within the movieclip itself, I have a dynamic text on it named "btnName". How do I access the dynamic text in the main timeline? I tried menuBtn.btnName.Text = "something" and it doesn't work.
btnName.Text = "something" doesn't work either.
Any correct way to access it?
I have a dynamic text box inside a movieclip that is generating load percentage eg: 40% etc. I have two Scenes, the first scene preloads the entire movie (this works fine, has the numbers plus percentage).
The second scene runs a movieclip preloader (while reusing the same dynamic text box in the same movieclip) - For some reason the % is not showing up after the numbers, I know its working because when I trace what the text is in the dynamic textbox during the script it shows the % sign after the numbers in the output window.This also occurs with all the other punctuation glyphs I try, not just the % sign...
I'm writing a menu generating script. It's suppose to display arrays
and any inner arrays.
Ex:["test item",["item 1",["item 2","item 3"]],"item 4"];
These movie clips should be displayed if the actionscript is correct.:
test item
item 1 <---this of course, has a following subarray
item 4
and the submenu should display:
item 2
item 3
I run the script and it see's the inner array items ["item 2", "item 3"] and shows them in the next submenu -FINE---but what I get in the main menu to my surprise is 'run-on text' in the Dynamic field of that movieclip. ex:
test item
item 1; item 2; item 3 <---? seems to concatonate inner items in text field
item 4
I only want to see text "item 1" ....not the items associated with it as well.
(they are already displayed in submenu)
Code:
for (var i = 0; i < menuArray.length; i++) {
var menuItemName = "mc_menu_item_" + i;
if (typeof(menuArray[i]) == "object") {
this["mc_menu_box"].attachMovie("h_menu_middle_sub", menuItemName, tempLevel);
Trying to write a script that load dynamic text from a .txt file.
Everything works fine until i tried to put the dynamic text inside a movieclip. There is a error generated which i dont understand.
Below is my code,
var myLoader:URLLoader = new URLLoader();
myLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
myLoader.load(new URLRequest("data.txt"));
[Code].....
I have a movieclip of instance name "menuBtn". And within the movieclip itself, I have a dynamic text on it named "btnName".
How do I access the dynamic text in the main timeline?
I tried menuBtn.btnName.Text = "something" and it doesn't work. btnName.Text = "something" doesn't work either.
The desired affect is simple: I have a single button... with each click I want it to load text into a dynamic text field and load a corresponding picture or movieclip.There are only three unique text/image combinations- after its displayed the third, with the next click I want it to just start over. All the text functions perfectly with each click.
The problem is:I use "createEmptyMovieClip" then use the resulting clip as a loader clip.. With the first click I want a movieclip from the library to load, so I use the "attachMovie" method- it displays the first library fine.With the next click I want to load an external swf- so I call the "loadMovie" method of the loaderclip... The external swf loads just fine replacing the first library clip.The third clip is where I have problems... now I want to load another library item into the loaderclip... so I tried using the attachMovie method again but the external swf remains static... then with the next click, I discover the first library item no longer loads and the external swf remains still playing- it's like once it's been loaded into the loaderclip it cant be moved...
So I tried adding the "unloadMovie" method in the code for the third click.. it successfully removed the swf... but the next line of code immediately after the unload statement, doesn't work. The line calls the attachMovie method for the loaderclip... but the library item doesnt load... Oddly enough, with the next click, the first library item now does load as if everything's fine... It seems like you cant use the unloadMovie and attachMovie on the same executing code? if that makes any sense... the basic idea was that if I couldnt get the attachmovie method to replace the loaded external swf, then I would use the unload method to remove it, then have code immediately after, to then execute the attachMovie method... but it still doesnt load the library clip. and I know it's not a type-o, because when I comment out the loadMovie and unloadMovie statements, it loads both the library items perfectly ? The code is below
var increment:Number = 1;
var verbiage1:String = "Hello World1";
var verbiage2:String = "Hello World2";[code].............
What happens in my flash file is I click on a colour swatch and that colour is then stored until I click on the part of the shirt I want to change colour. Once that part of the jersey has changed colour I want to be able to send the colour from just that section to a dynamic text field (to be emailed later as a reference). As an example, I click on "btn_orange" and then click on the Movie Clip "block1". "block1" changes to orange. As it changes I want to send "block1"'s colour to a text box called "hexcode1". If "block1" colour changes, then so will the text box "hexcode1". "block2" will be linked to "hexcode2" etc.
[Code]....
I've got an issue - When one of my buttons is rolled over, I want text and a movieclip to appear. When the button is no longer rolled over, I want the text and movieclip to disappear. The way that I was going to do this was to have anchor_mc as an anchor, and upon rollover have the movieclip play from inside the anchor (as its at the exact X & Y that its needed at) and dynamic text appear.
[Code]...