[F8] Adding Text Field In Scene 2
I have a two scene movie
In the second scene i have
Code: createTextField("word_txt", 2000, 100, 100, 300, 100); word_txt.multiline = true; word_txt.wordWrap = true; word_txt.border=true;
var my_fmt:TextFormat = new TextFormat(); my_fmt.color = 0xFF0000; my_fmt.underline = true; word_txt.text = "This is my first test field object text."; word_txt.setTextFormat(my_fmt);
If I export the whole movie this doesn't work
If I export just the second scene it does work.
What do I need to alter to make it work if I export the whole scene
THanks in advance
FlashKit > Flash Help > Flash ActionScript
Posted on: 10-16-2008, 10:44 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Help With Passing Number From Scene 1 To Scene 2's Dynamic Text Field
hi all ,
i have 2 scenes on the first i retreve user information from flash and through php to a mysql database then send it back to flash. on one of the lines i retreive a id number
content.htmlText += " <a href='#" + this["id"+i] + "'>" + this["id"+i] + "</a><br><br>";
when the user clicks on this ahref i want to goto scene 2 and insert the id into a dynamic textfield with an instance name of "recorde_id"
this scene is complete and works it retreives more infor about the user..
but i have to manualy enter a id number into a INPUT filed i want it to be automatic that why i have changed it to be dynamic so it can capter the ahref from scene 1.. if you need more code or information just ask and ill deliver, im a flash newbee..
cheers aron.
Adding Text Field Using As
this is a rather basic question.
I've been creating my elements in flash, and then deleting them from the stage and then adding and controlling them with as. (var lala:thumb = new thumb()
so i'd have an item in my library with the class of thumb.. you know.. the regular way. but, you can't have a text field in your library, so I could just put a text field inside a movie clip, or preferably a sprite, and then give it an instance name to get at it to change the text.
or I could create the text field completely in as. but that seems to be more involved, and i guess i just wanted to avoid it because I wanted to design using flash..
so my question is, could anyone give me any tips or point me in the direction of the simplest route of integrating text. should I use AS? is it easy to use fonts besides system fonts? any pointers really.. thanks..
Adding Value Of A Text Field To A URL?
Hi! Total Flash newbie, here.
I'm trying to put together a quick little Google site search box for a Flash site I'm building. I'm not doing something right with the syntax, however - I can't figure out how to add the contents of the "search" box to the URL. This is what I'm trying to do with the submit button:
Code:
on (release) {
getURL("google URL part 1"+ Contents of Search Box goes here, which is what I'm having trouble with + "google URL part 2", "_blank");
}
It works fine when I just add the search term to the URL manually. I just need to know how to grab that data from the text field.
Any help is appreciated. Thanks!
Adding To A Dynamic Text Field
Is there a way to add info to a dynamic text field?
For example, if an object on the stage is pressed it's name and color get sent to a text field. When another one gets pressed i want it's name and color to be added below the previous one so a list is created. But, if the shape and color is changed on the first object it will update the text field that previously described it. Is this possible?
Help Needed Adding Listener To Text Field
I have two text fields, one above the other, which will be pulling in text dynamically.
The second text field should position itself depending on how high the first field is. Normally I would use an empty movieclip and som onClipEvent (enterFrame) to control the second text filed, but this time I want to do it right using a listener.
However I am not sure what to put into the code which will trigger the listener. I want something like "onChange" but that doesn't seem to exsists. I've tried with "onLoadComplete" but no luch there either
This is my code. Can anybody push me in the right direction:
PHP Code:
var introListener:Object;
introListener = new Object();
introListener.onLoadComplete = function ():Void{
pagetext_txt._y = intro_txt._y + intro_txt._height+10;
trace("called listener");
}
intro_txt.autoSize = true;
intro_txt.addListener(introListener);
intro_txt.text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit., dolor sit amet, consectetuer adipiscing elit. Praesent nisl felis, semper sit amet, mollis condimentum";
pagetext_txt.text="second text";
Adding An Event Listener To A Text Field
I need to add an event listener to a text field. Essentially, I want to execute some function every time new text is added to the field. Input to the text field happens through a virtual keyboard, not a real keyboard. So, is it possible to add an event listener that will accomplish this to a text field? Something like...
textFieldOne.addEventListener(SomeKindofEvent.Some thingHappensHere,SomeFunction)
muchas gracias,
Tap
Adding A Text Field To A Number Of FLA Files
I have a number of SWF and now I need to add an entry text field to all of
them.
I do not want to find myself creating a text field in every single FLA
I wonder if I can create in, say, in an .AS file using something like
createEmptyMovieClip and then include it into relevant FLA?
Or what other solutions are available?
Adding Text To HTML Field With Actionscript
okay,
maybe I just don't know the syntax...but I got a dyanmanic text field name "fred"
and another dyamanic text field with a calcualted value, name "burt"
when the frame starts daysold = "365"
fred is an html text box and
I want fred to = "<b>hi I'm " + daysold + "days old</b>"
this don't work,
if fred is NOT an html text box...works fine.
why?
the paln is to change part of the result, font color, size with HTML?
any ideas?
thanks
jef
Adding Text With Color To A Text Field
I want to add text to the same field, however change colors when add additional text (on btn 2). How could I do that with this code?
btn.onPress = function () {
_root.text_field.text = "Text Here"+"
";
}
btn2.onPress = function () {
_root.text_field.text += "More Text Here" +"
";
}
}
Adding Text To Dynamic Text Field (help Please Heh)
hi everyone,
rather simple question im sure..
I have a dynamic text box that already has text in it, and on the push of a button I'd like to add text to the box, rather then just set the variable to new text..
for example the box as one "X" in it, and I need to add another so that it displays "X X", and so on...
help is much appreciated!
- lenny
Text Input Field Not Linking To Scene?
I have a text input that will link to a given basic frame, but I want it to link to a specific frame inside a Movie Clip. Code for going to basic frame is below:
ActionScript Code:
stop();
if (Key.isDown(Key.ENTER)){
if (textinput.text == "word"){
gotoAndStop(2);
}
}
URGENT Adding Scrollbars To A Dynamic Text Field
I have put a Dynamic text field in my flash. To load in a HTML text (news.txt).
But the file is to long and i want to add a scroll bar to scoll up and down the text field.
I know this can be done but i dont know the script to do this.
I have been to tutorials and there all in flash 4 and the script is different according to my debugger.
If you could do a small example of how to do this in flash and then send it me to, so i can rip it to pieces and see how it works it would be MOST welcome!
mailto:wannabslim@iamwasted.com
Thanks Rob
http://www.darwen-moorland.f2s.com/ratweb.html my first flash
Adding Html Formatting To External Text Field
Hi, apologies if you read this post in my previous entry, i should have started it as a new topic..
I've got a dynamic textfield calling an external text file from the server OK, but I want to add a bit of formatting e.g. bolding the titles. I've read a few posts on this, but am getting a headache working out what I change in my code! Or do I change something in the external file itself?
The textfield is called load_txt (the var: my_lv)
The action applies to the layer is:
my_lv = new LoadVars();
my_lv.load("http://www.europahost.net/nrg/load_txt.txt");
my_lv.onLoad = function(success) {
if (success) {
load_txt.htmlText = this.load_txt;
trace("loaded");
} else {
trace("not loaded");
}
};
Thanks in adv
andy
Adding Buttons/links To A Scolling Text Field
I'm trying to make an online catalog of an art collection, so I have a scrolling text box, with many names listed, and I want each name to link to a new page with images of the artwork. I was planning to make the box with each name as a separate button, until I ran into what seems like the problem of not being able to have buttons in a text field. PLEASE..any suggestions on how to make this work? I need to figure this out urgently..thanks!
Adding Text To Input Field At The Click Of A Button
The www.bbc.co.uk/raw has a flash move at http://www.bbc.co.uk/raw/gamesandquizzes/storytelling/ choose "story writing" (left selection).
It has a simple way of adding text by clicking the button and adding it to the input field where the curser is left.
I have tried to repeat it with external .txt files but all i seem to be able to do is replace all the text when I click the button.
Can anyone guide me in the right direction or even give me an idea what this function is called so I can add it to my project.:confused:
Thanks
Chris
How Do I Import .txt Or .html File As A Scrolling Text Field In Scene?
i need to add a text field/box/area to an existing scene whereby a text file or html file can be reference for the content. the 'cleint' needs to update the site content themselves but has no knowledge of flash and wants something quick and easy (like editing a simple text docuiment).
i have found a couple tutorials on adding a text field that references a .txt file (see code below), but i cannot figure out how to make the text box scroll.
loadVariablesNum ("content.txt", 0);
stop ();
i am using flash 5.0. only moderate knowledge level.
pleeeeaaasssseeee help if you can. deadlines are the worst.
thanks in advance...tk
Trying To Pass Text From Form Text Field To A Flash Dynamic Text Field
Hi, I was hoping someone might enlighten me as to how/if I can do this...
Currently I'm using javascript which works fine to pass text from textfield A to textfield B:
Code:
window.onload=function()
{
document.forms.form1.shirtText.value=document.forms.form1.KitGroupID_16_TextOption_38.value
}
Is there a way to pass the textfield A text to a dynamic text input (flash) as I'd like to use the font embedding flash offers. I can make it work when loading a value from a txt file but I'm not sure how to access the value identified above as KitGroupID_16_TextOption_38 and make it appear in a dynamic input box. Eventually I might want to have 3 font choices for the user but I'd like to just see if I can get this working properly first.
Your help/advice would be greatly appreciated,
-Scott
Adding Scene Issue
Hi !
I did flash project in one scene. I put preloader in frond of it (in new scene). Preloader works fine, but the code in next scene doesn't work at all!!!!
I didn't find any solution. I tried to paste all frames to new empty movie with two scenes. Script started to work, but gotoAndPlay commands dont work correctly.
Leos
Trouble With Adding A New Scene
Hi,
I have a main scene that begins with a animation. Now when i add a new scene to house a preloader and place it above the main scene and play the movie the preloader works fine but when it plays the next scene everything stops at frame 1. At 1st I thought it was my preloader but i tripled checked it and it was fine, I also just added a blank scene but i get the same problem. Im using flash 8. ne 1 ever get this problem?
thx
Problems Adding Just A Scene
hi guys,
i am getting in pain just adding a second scene to my flash 8 artwork.
...i have finished an intro and now the movie should jump to a second scene using gotoandplay("scene2", 1).
as soon as i add the second new scene from the scene inspector and play the movie, i get a movie that stops playing to the first (i think it's so) frame of first scene....well at the end ...as soon as i add a scene, the movie stops. no code added or removed!!!it's strange!!!
please helppppp
thank
adro
Adding A Link To Scene
Hi,
I am a total beginner in Flash and wanted to know, how to add a link that opens in a new window to a scene?
I found out that on AS2 it was done in a manner similar to:
ActionScript Code:
on (release)
{
getURL("http://www.google.com",_new)
}
or something like that.
Right now I got to this:
ActionScript Code:
Scene.addEventListener(MouseEvent.CLICK,goTo);
function goTo(e:MouseEvent) {
var request:URLRequest = new URLRequest("http://www.google.com/");
navigateToURL(request);
}
But I get an error 1061
Basically I need to add a link to another web page on my banner.
Help please?!
Adding Variables To URL Field
Hello All,
I need some help here. I need to assign a variable to the "GetURL" field in a button. This way I can have my buttons URL's Dynamically generated from a database by storing the URL address in a database field. I have tried placing my URL address variable into the "GetURL" field but it does not work. Any help would be appreciated. Thank You.
Steve
Adding A Scene Distorts Images
This seems very strange to me, but why would adding a scene to the movie lower the quality of the images I am using. I have images that look fine, but if I just add a scene to the movie the quality goes way down.
Thanks for the help,
Todd
Adding All Instances In A Scene To An Array
I want to instruct actionScript to look at my scene, go though each item on it (e.g. all of the check boxes and radio buttons) and add each of these items that have got an instance name into an array.
I can't think of a simple solution to this. Can anyone help please?
Adding All Instances In A Scene To An Array
I want to instruct actionScript to look at my scene, go though each item on it (e.g. all of the check boxes and radio buttons) and add each of these items that have got an instance name into an array.
I can't think of a simple solution to this. Can anyone help please?
Adding Up Score From Movieclip To Scene
Hi, I am doing a quiz game project using flash that is due soon. I am having a bit of problem with adding up score from many movieclips and displaying it on another scene.
Any help is deeply appreciated.Thanks in advance.
Blurry Graphics When Adding A Scene
Hello...i'm new at this forum and here's my first question:
When i add an extra scene to my movie (flash MX 2004) than all my graphics become blurry like a bad jpg. When i delete the scene again, the graphics are perfect.
Is this a bug in flash or am i doing something wrong? The graphics I imported are png or jpg.
I tried some changes with the jpg publishing quality, but that didn't work.
So..anyone with the solution?
Thnx in advance.
Adding A Field To A Php Simple Form
i have nabbed a simple Php form that anyone can use that allows you to send send your "email address", "name" and a "messages". What i am wanting to do is put in one more field in for a phone number.
I thought if i just looked at the code i should be able to figure it out but simple me is having a bit of trouble.
This is what i am working with:
TEXT FIELDS
3 text fields with the varible names of FirstName, Email and ToComments
ACTION SCRIPT AND PHP FILE SCRIPT
the send button Action script and PhP file script is as shown below
the PHP Script is:
PHP Code:
<?
$ToEmail = "look@protoform.com.au";
$ToSubject = "Mailing list subcriber";
$EmailBody = "Sent By: $FirstName
Senders Email: $Email
Message Sent:
$ToComments
";
mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From: ".$FirstName." <".$Email.">");
?>
Send button Code
Code:
on (release) {
if (!FirstName.length) {
EmailStatus = "Please Enter your name.";
}
else if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
EmailStatus = "Please enter a valid E-mail";
}
else if (!ToComments.length) {
EmailStatus = "Please enter your message";
}
else {
loadVariablesNum ("MailPHP.php", "0", "Post");
gotoAndPlay(10);
}
}
So there you have it not much there but i really need a Telephone number option.
Thanks in advance
Age
Adding 2 Sound Fx To A Scene But It Interupts The First Loop
Hi, i am working through one of the tutorials in swish and i have come accross a problem. IN THE TUTORIAL "THIS IS MY MESSAGE" i have added the vector graphics and the initial sound. However i wanted to added a sound effect when the first picture loaded in. When i did this my first sound loop cuts of then startes again when the sound fx is meant to cut in. So i look at sound/actions panel. I loop 88amp3 15 times and then at my first jpeg i loop a sound fx once. But when i play the whole scene my sound fx cuts in through the whole thing. When i go back to the sound panel i find that the setting have changed and the soundfx wants to play 15 times now overiding my initial 88amp3 sound loop. Its just that in future i want to put key sounds along side pics loading in and what not, and im not sure how to co-ordinate this. Anyone know what im doing wrong? Im pretty sure im close but i cant find the solution. Any takers?
Regards,
Gibbo.
Images Look Crappy When Adding Preload-scene
I have an imagesequence that should be exported with the swf in highest quality. Works great on it self and all, no problem whatsoever, UNTIL....
I added a preloader in a scene
Now when I export, the images look all crappy! Almost bitmap-like. I swear I've checked the properties of all images and the export-settings and all that.
Can someone help me with this problem?
Much appreciated,
Mediamonkey
Adding Scene Makes Images Fuzzy
I have a flash movie (flash 5) with imported PNGs for buttons. When I add a new scene (either by duplicating or adding new), the quality of these images plummets, even though I have the publish settings set to 100% jpg quality. As soon as I delete the new scene(s), the quality is restored. Obviously I can't publish a movie with poor quality images (it's like they've been enlarged and then over-sharpened in paintshop pro or similar, except they haven't). Does anyone know if/how I can remedy this? TIA
Help Adding Moviclips/Btns To My Papervision Scene
Please help. I'm new to papervision and AS3. I'm trying to spin a cube with materials and interact with buttons on the cube. I was able to assemble this:
http://www.methodengine.com/clients/...vidboxspin.swf
It shows my cube with my materials. I placed buttons over the box that spin it. I would like those buttons to actually appear and spin on the cube itself.
Can anyone out there point me in the right direction. I was able to add movieClips on the stage, but no in the front cube material.
Here is my code to make this happen:
ActionScript Code:
package {
import flash.display.*;
import flash.filters.*;
import flash.events.*;
// Import Papervision3D
import org.papervision3d.events.InteractiveScene3DEvent;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.materials.*;
import org.papervision3d.utils.virtualmouse.VirtualMouse;
import org.papervision3d.utils.virtualmouse.IVirtualMouseEvent;
import org.papervision3d.utils.*;
import org.papervision3d.objects.*;
import flash.text.TextField;
import flash.utils.*;
public class Main extends MovieClip {
public var mc :MovieClip;
// ___________________________________________________________________ 3D vars
var container:Sprite;
// var scene:Scene3D;
var scene :InteractiveScene3D;
var camera:Camera3D;
var ism:InteractiveSceneManager;
var plane:Plane;
var time:Number;
var tweening:Boolean = false;
var myVidfront:Boolean = true;
var mouse:Mouse3D;
var vMouse:VirtualMouse;
var material:InteractiveMovieMaterial;
public var myVidContainer:MovieClip;
private var frontMaterial:BitmapFileMaterial = new BitmapFileMaterial("images/player2_back.png");
private var backMaterial:InteractiveMovieAssetMaterial = new InteractiveMovieAssetMaterial("flv", true, true);
private var targetrotationY:Number = 0;
var p:Cube = new Cube(new MaterialsList( {
front: frontMaterial,
back: backMaterial,
left: new ColorMaterial( 0x000000),
right: new ColorMaterial( 0x000000),
top: new ColorMaterial( 0x000000),
bottom: new ColorMaterial( 0x000000)
} ), 800, 100, 500, 1, 1, 1);
public function Main() {
init();
time = getTimer();
}
public function init():void {
stage.scaleMode = "noScale";
// add a spin btn
var spin180_btn:PlayVid= new PlayVid();
spin180_btn.x = 500;
spin180_btn.y = 25;
addChild(spin180_btn);
// add another spin btn
var spin360_btn:PlayVid= new PlayVid();
spin360_btn.x = 400;
spin360_btn.y = 25;
addChild(spin360_btn);
init3D();
addEventListener( Event.ENTER_FRAME, loop );
spin180_btn.addEventListener(MouseEvent.CLICK, spin180);
spin360_btn.addEventListener(MouseEvent.CLICK, spin360);
}
// ___________________________________________________________________ Init3D
public function init3D():void {
// Create container sprite and center it in the stage
container = new Sprite();
addChild( container );
container.name = "mainCont";
container.x = 270;
container.y = 200;
// Create scene
scene = new InteractiveScene3D( container );
ism = scene.interactiveSceneManager;
scene.addChild(p);
p.rotationX = 0;
p.rotationZ = 0;
p.rotationY = 0;
p.x = stage.stageWidth / 4;
p.y = -100;
var moreVids_btn:MoreVids = new MoreVids();
moreVids_btn.x = 480;
moreVids_btn.y = -130;
// scene.container.addChildAt(moreVids_btn,1);
moreVids_btn.addEventListener(MouseEvent.CLICK, spin360);
// Create camera
camera = new Camera3D();
camera.zoom = 10;
camera.sort = true;
}
private function spin180(event:Event):void {
tweening = true;
trace(p);
if(myVidfront){
myVidfront = false;
targetrotationY = 180;
}else{
myVidfront = true;
targetrotationY = 0;
}
}
private function spin360(event:Event):void {
tweening = true;
if(myVidfront){
myVidfront = false;
targetrotationY = 360;
}else{
myVidfront = true;
targetrotationY = 0;
}
}
// ___________________________________________________________________ Loop
function loop(event:Event):void {
if (tweening) {
if (p.rotationY <targetrotationY) {
p.rotationY += Math.sqrt(targetrotationY-p.rotationY);
p.rotationY = Math.round(p.rotationY);
} else if (p.rotationY> targetrotationY) {
p.rotationY -= Math.sqrt(p.rotationY-targetrotationY);
p.rotationY = Math.round(p.rotationY);
}
}
scene.renderCamera( this.camera );
}
}
}
Adding New Frames Before Game Scene [mucking Up]
Got a game, asteroids, and it works fine, but when i move the frames along 1 so that i can add an into screen, with high scores and a play button, it throws off all my remove movieClips.
if anyone know as to why, would be great help.
TextFormat Not Working After Adding Field To MovieClip
Hello,
I was just figuring how to use TextFields with TextFormat.
I ran into the following problem. I just copied some code somewhere from Adobe.com just to figure out how it all works. OK, so far so good.
Now what I wanted to do was to dynamically create a TextField and add that to a MovieClip, however, nothing shows up.
I have attached my code, if you comment out the MovieClip part and remove the slashes on line 17 it works fine.
Please help me out! Thanks.
Attach Code
// Create a new instance of the Font1 symbol from the document's library.
var myFont:Font = new Font1();
/* Create a new TextFormat object, and set the font property to the myFont
object's fontName property. */
var myFormat:TextFormat = new TextFormat();
myFormat.font = myFont.fontName;
myFormat.size = 24;
/* Create a new TextField object, assign the text format using the
defaultTextFormat property, and set the embedFonts property to true. */
var myTextField:TextField = new TextField();
myTextField.autoSize = TextFieldAutoSize.LEFT;
myTextField.defaultTextFormat = myFormat;
myTextField.embedFonts = true;
myTextField.text = "The quick brown fox jumped over the lazy dog.";
//addChild(myTextField);
// Create a MovieClip
var movieClip:MovieClip = new MovieClip();
movieClip.x = 0;
movieClip.y = 0;
movieClip.width = 200;
movieClip.height = 50;
movieClip.addChild(myTextField);
addChild(movieClip);
TextFormat Not Working After Adding Field To MovieClip
Hello,
I was just figuring how to use TextFields with TextFormat.
I ran into the following problem. I just copied some code somewhere from Adobe.com just to figure out how it all works. OK, so far so good.
Now what I wanted to do was to dynamically create a TextField and add that to a MovieClip, however, nothing shows up.
I have attached my code, if you comment out the MovieClip part and remove the slashes on line 17 it works fine.
Please help me out! Thanks.
Attach Code
// Create a new instance of the Font1 symbol from the document's library.
var myFont:Font = new Font1();
/* Create a new TextFormat object, and set the font property to the myFont
object's fontName property. */
var myFormat:TextFormat = new TextFormat();
myFormat.font = myFont.fontName;
myFormat.size = 24;
/* Create a new TextField object, assign the text format using the
defaultTextFormat property, and set the embedFonts property to true. */
var myTextField:TextField = new TextField();
myTextField.autoSize = TextFieldAutoSize.LEFT;
myTextField.defaultTextFormat = myFormat;
myTextField.embedFonts = true;
myTextField.text = "The quick brown fox jumped over the lazy dog.";
//addChild(myTextField);
// Create a MovieClip
var movieClip:MovieClip = new MovieClip();
movieClip.x = 0;
movieClip.y = 0;
movieClip.width = 200;
movieClip.height = 50;
movieClip.addChild(myTextField);
addChild(movieClip);
TextFormat Not Working After Adding Field To MovieClip
Hello,
I was just figuring how to use TextFields with TextFormat.
I ran into the following problem. I just copied some code somewhere from Adobe.com just to figure out how it all works. OK, so far so good.
Now what I wanted to do was to dynamically create a TextField and add that to a MovieClip, however, nothing shows up.
I have attached my code, if you comment out the MovieClip part and remove the slashes on line 17 it works fine.
Please help me out! Thanks.
Attach Code
// Create a new instance of the Font1 symbol from the document's library.
var myFont:Font = new Font1();
/* Create a new TextFormat object, and set the font property to the myFont
object's fontName property. */
var myFormat:TextFormat = new TextFormat();
myFormat.font = myFont.fontName;
myFormat.size = 24;
/* Create a new TextField object, assign the text format using the
defaultTextFormat property, and set the embedFonts property to true. */
var myTextField:TextField = new TextField();
myTextField.autoSize = TextFieldAutoSize.LEFT;
myTextField.defaultTextFormat = myFormat;
myTextField.embedFonts = true;
myTextField.text = "The quick brown fox jumped over the lazy dog.";
//addChild(myTextField);
// Create a MovieClip
var movieClip:MovieClip = new MovieClip();
movieClip.x = 0;
movieClip.y = 0;
movieClip.width = 200;
movieClip.height = 50;
movieClip.addChild(myTextField);
addChild(movieClip);
Calculating Input Text Field To Dynamic Field (easy Action Script)
hi. i'm trying to learn action script and i need help with this bit. i'm trying to use action script to calculate my brothers ages based on my own.
using flash MX. i have an input field called "my_age" and two dynamic fields called "eli_age" and "jacob_age". eli is 4 years younger and jacob is 6 years younger. i want to be able to enter my age in the "my_age" input field and then click a button that will calculate their respective ages.
here's the fla if i haven't been clear.
thanks for any/all help,
josh
Flash Contact Form - Adding A Drop Down Field
Hi all
Just trying to work out how to put a drop down field into a flash contact form. So that if they select one of the four options, it adds said selected option to the subject line of the email, when sent. Any ideas?
ta!
Getting A Text String Value From A Text Field And Duplicating It In Another Text Field
I'm trying to take the text from one text field and duplicate it in another.
I want to display the text that is in the text field _root.MC_Control.tab_title in another text field called _root,video_title.
I have tried this:
_root.video_title.text = _root.MC_Control.tab_title.text;
and this:
_root.video_title.text == _root.MC_Control.tab_title.text;
neither one seems work....am I missing something?
[FMX04] AS - Showing Text Field As HTML Field With XML/CDATA.
Hey all -
Trying to get a text field in my Flash MX movie to pull from and XML file with CDATA tags to show as HTML. I've checked the box to render as HTML for the text data field... but I'm having problems with the Actionscripting.
The field from this line is what I need to recognize as HTML reading CDATA tags:
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
I know I need to do more than just change it to ".html" instead of ".text" and have tried a couple things, but nothing seems to work.
Any help greatly appreciated!
Code:
//Create the XML Object
myXML = new XML ();
myXML.load(newXml);
myXML.ignoreWhite = true;
//Load XML file
myXML.load("PBintro.xml");
//Make a reference to current timeline
myXML.ref = this
// Parse XML and fetch
myXML.onLoad = function(success){
if(success){
var root = this.firstChild ;
nodes = root.childNodes
for(var i=0; i<nodes.length; i++) {
this.ref["Title_txt"+i].text = nodes[i].attributes.name
subnodes = nodes[i].childNodes
this.ref["Comments_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i] = subnodes[1].firstChild.toString()
this.ref["holder_mc"+i].loadMovie(subnodes[2].firstChild.toString())
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
this.ref["textField"+i] = subnodes[4].firstChild.toString()
}
} else trace("Error loading XML document")
}
Input Text Field To Dynamic Text Field
Ok, I have an input text field with a variable name of "enter", and a dynamic text field with a variable name of "display". I also have a button on the stage. I want it so that when you press the button, it checks what the user has put into the input text field, and if it is valid it will display a certain message in the dynamic text field.
For example:
If the user types in "hydrogen" and then clicks the button, I want the dynamic text field to display the letter H. Likewise, if the user types in "oxygen" and then clicks the button, I want the dynamic text field to display the letter O. And finally, if the user types in something that is not specified in the code, it will just display "Not Valid".
I tried doing this with an on(release) action and then some if statements, but nomatter what I typed in it would always display H. I'm probably overlooking something simple, but nonetheless, I need help. Thanks
Input Text Field Into Dynamic Text Field
Hey guys,
I'm really new to AS 3.0. I would like to transmit information from an input text field into a dynamic text field once a submit button is clicked.
Any help would be greatly appreciated.
I'm using CS3 AS 3.0. Thanks!
XML And MC Text Field Propigation (text Field Appear At Frame 2)
I am using xml and actionscript to propicate two fields in a mc.
The problem I am having is that both fields dont show up until the second frame of the mc. since they are not on the first frame the xml doesnt propicate the fields.
Is there any way to refence a field on the second from of a MC
I am using the following code:
Code:
function loadXML(loaded) {
if (loaded) {
_root.attractions = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.description = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
_root.theaterinfo.header.text = _root.attractions;
_root.theaterinfo.description.text = _root.description;
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("attractions.xml");
stop();
The text boxs header and description dont appear until the second frame of the MC theaterinfo
If i move these text field to the first frame they propigate with their text just fine. once they are moved to the second frame they no longer work.
edit: I also would like to mention that the movie clip theaterinfo has frame one blank with a stop(); command and then on frame 2 the dynamic text fields are referenced.
all help is much apreaciated
Thanks
|