Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Dynamic Field Content Reseting After A Tween



hey all

i'm going to attach an .fla to this post since it might help, but here's the problem: two dynamic text fields inside movieclips, which are both inside a parent movieclip. the content of the fields is set on the root timeline. you mouseOver the whole thing, and the two movieclips with the textfields move apart.

but, the clip that's under a mask resets its content to what was typed on the stage, not the content that was set in AS. remove the mask, and there's not a problem, but the mask is fairly essential. any help would be greatly appreciated.



FlashKit > Flash Help > Flash ActionScript
Posted on: 03-31-2006, 12:41 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Reseting Form Field
I've created a simple form with one input field for viewers to submit an email address to join a mailing list. It works great, the only problem is after they click the submit button, the input field (message) doesn't reset OR my dynamic text field (mailstatus) thanking them for joining. Can anyone help?

this is the actionscript for my button:

on (release) {
subject = "Mailing List";
this.loadVariables("http://www.djbreak.com/simplemail.php", "POST");
}

this is my php script:

<?php

$email ="breakgetnice@aol.com";

$subject = $HTTP_POST_VARS['subject'];

$message = $HTTP_POST_VARS['message'];

mail($email, $subject, $message);

echo "mailstatus=Thank you for joining!&thescript=done&";

?>

Calling Dynamic Content From Another Dynamic Field
Hi ppl

I am new 2 this forum and i am quite week in Action Script !!!!!! I have been posting this 2 almost all forums possible but failed 2 get the apt reply !!!! If any 1 here Knows the sollution plz tell me in a bit lucid way so that i can grasp !!!!!

My question is :

How can v load data into a variable from a text file by clicking on a hyperlink created in HTML!!! In fact my intention is 2 load a text file containing the hyper link, first and then after pressing the link another text file gets loaded !!!! in its place !!!!!! Hope u get me !!!!

Hopefully
JIkku Jose
Jiks

Tween Dynamic Text Field (MX)
Is it possible to tween a dynamic text field(content being read from external txt file). I cant seem to find any sites that really say yes/no.

My objective is to have a customized scroller (yes I know MX comes with a scroller component, but I dont like how it looks). I want the dynamic text field to scroll up/down with an onmouseover on my up/down arrows.

Is it possible to change the looks of the scroller component?

I tried to add a new key frame in each field (duplicating each field, just moving the text box up/down a bit), but it didnt seem to like that and it would display the text anymore, although the box would move, but again, no text.

Any suggestions would be great

Thanks.

Rotated Dynamic Text Field --> No Content
Hello,

I've got a dynamic text field in a movie clip. There's no Problem showing the right content in the field, until i rotate the movie clip or the text field.
When the text field is rotatet i don't see it on the preview.

i tried a lot of possible ways to show text in this rotated text field, without any result. I'm still

Please help me

Thank you

Regards
Fabio

Showing XML Content On A Dynamic Text Field
Hi there, i´m trying to read an xml file content and display it on a flash dynamic text field i take the AS code from a tutorial on the web, but it´s not working, i didn´t receive any errors on it it´s just shows the empty text field. Can anyone help me out with this?


PHP Code:



//Declara la variable "obj_xml" como un objeto XML
function  loadXML(loaded)  {

if (loaded) {

inventor = this.firstChild.childNodes[0].childNodes[0].firstChild;
mostrador_txt.text = inventor;
} else {
  trace("file not loaded!");

}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("datos.xml"); 




And this is the xml file:

PHP Code:



<?xml version="1.0" encoding="iso-8859-1"?>
<!--<!DOCTYPE note SYSTEM "note.dtd">-->
<siteconastec>
    <principal>El alcance de este asesoramiento abarca el brokerage de sociedades, los comodities, la consultoría general en materia de finanzas, y el servicio de soporte y asesoría operativa.</principal>
    <integrantes>
    </integrantes>
    <clientes>
    </clientes>
    <servicios>
    </servicios>
</siteconastec>



I only want to show the existing text.

Thanks
Juan

Dynamic Text Field: Can I Preload Content?
So, I thought it would be a great idea to use a dynamic text box to load html formatted text and images. The box works, but the response time is really slow. I'm having multiple text fields load over each other and images take for ever to load ( a 14kb PNG takes upwards of 5 seconds).


Is there a way to preload the .txt files and images that are not embedded in the SWF?


Here's the site if anyone wants to take a look:

www.alexcaton.com


http://www.actionscript.org/forums/i...es/redface.gif

Printing Dynamic Text Field Content...
blah... bluh... I realy hava a huge problem!

I'm working on of the most important projects in my life! that's school web site www.aat-edu.org - I did all the design and little bit of flash... but my client wants a print button, that will print that dumb text...

I have a dynamic text field, text is loaded from the external text file...

it looks like this:

ActionScript Code:
onClipEvent (load) {
    loadVariables("news.txt", this);
}
onClipEvent (data) {
     _root.scrolltxt.htmlText = this.MyText;
}

and now, I have to make a button that will print the content of the text file...
I drafted this code:


ActionScript Code:
on (release) {
print(_root.scrolltxt.htmlText,"bframe");
}

but the dumb button prints the whole page... I mean with all those buttons, but it is supposed to print only the content of the dynamic text field!

would be enormously glad if someone could help me out with this...

Dynamic Text Field Content Does Not Display In .swf
I am very new to Flash. I'm trying to update a dynamic text content in a .fla that someone else created. It seemed a pretty trivial task but I can't figure out why I do not see the current text displayed (before I made any changes) when I preview or build the .swf?
I've debugged the actionScript code and I see the dynamic text variable being set but like I said, it's as if this code is not executed when the movie plays.

Any help would be greatly appreciated. Thanks.

Below (and attached) is the actionscript 2.0 code that updates the dynamic text variable (daTextBox2):
(I'm not sure the code was attached to the thread because I got a runtime exception)

onClipEvent (load){
daTextBox2 = "<p align="left"><font face="Helvetica" size="14" color="#cccccc" letterSpacing="0.000000" kerning="1">“The Gift of Art”</font></p><p align="left"></p><p align="left"><font face="Helvetica" size="11" color="#cccccc" letterSpacing="0.000000" kerning="1">Presenting Fine Art Accessories By</font></p><p align="left"></p><p align="left"><font face="Helvetica" size="13" color="#cccccc" letterSpacing="0.000000" kerning="1">AKOSUA <font size="11">– Jewelry & Adornments</font></font></p><p align="left"></p><p align="left"><font face="Helvetica" size="13" color="#cccccc" letterSpacing="0.000000" kerning="1">MARVIN SIN <font size="11">– The Art of Leather</font></font></p><p align="left"></p><p align="left"><font face="Helvetica" size="13" color="#cccccc" letterSpacing="0.000000" kerning="1">MANDISA <font size="11">– Jewelry </font></font></p><p align="left"></p><p align="left"><font face="Helvetica" size="13" color="#cccccc" letterSpacing="0.000000" kerning="1">NOVEMBER 17 & 18, 2007</font></p><p align="left"><font face="Helvetica" size="13" color="#cccccc" letterSpacing="0.000000" kerning="1">SAT: 11 – 7 / SUN: 12 - 5</font></p><p align="left"></p><p align="left"></p><p align="left"></p><p align="left"></p>";
scrolling = 0;
frameCounter = 1;
speedFactor = 3;
}








Attach Code

onClipEvent (load){
daTextBox2 = "<p align="left"><font face="Helvetica" size="14" color="#cccccc" letterSpacing="0.000000" kerning="1">“The Gift of Art”</font></p><p align="left"></p><p align="left"><font face="Helvetica" size="11" color="#cccccc" letterSpacing="0.000000" kerning="1">Presenting Fine Art Accessories By</font></p><p align="left"></p><p align="left"><font face="Helvetica" size="13" color="#cccccc" letterSpacing="0.000000" kerning="1">AKOSUA <font size="11">– Jewelry & Adornments</font></font></p><p align="left"></p><p align="left"><font face="Helvetica" size="13" color="#cccccc" letterSpacing="0.000000" kerning="1">MARVIN SIN <font size="11">– The Art of Leather</font></font></p><p align="left"></p><p align="left"><font face="Helvetica" size="13" color="#cccccc" letterSpacing="0.000000" kerning="1">MANDISA <font size="11">– Jewelry </font></font></p><p align="left"></p><p align="left"><font face="Helvetica" size="13" color="#cccccc" letterSpacing="0.000000" kerning="1">NOVEMBER 17 & 18, 2007</font></p><p align="left"><font face="Helvetica" size="13" color="#cccccc" letterSpacing="0.000000" kerning="1">SAT: 11 – 7 / SUN: 12 - 5</font></p><p align="left"></p><p align="left"></p><p align="left"></p><p align="left"></p>";
scrolling = 0;
frameCounter = 1;
speedFactor = 3;
}

Dynamic Text Field, Content And Alpha
Hi.

I have a MovieClip (mcContainer) that contains a dynamic text field (txt1), that was created directly on the Stage. Then I added text to the text field with:

this.mcContainer.txt1.text = "my wonderful text";

When I change the mcContainer's alpha, the text's alpha doesn't change. So, what am I doing wrong?

Thank you in advance.

[Help] Resize Dynamic Text Field To Fit The Content.
Dear all,

I'm now trying to add a dynamic text field in FLASH.
And, the question is:

Can the TEXTFIELD resize to fit the content using ActionScript?

I mean, if the content only contain 2 words, then the textfield resize and fit only 2 words.
(assume 10px for a word, then the text field will be 20px)
And if the content had 20 words, and the text field enlarge and fit the content.
(same assumption, the textfield enlarge to 200px.)

Thanks!

Dynamic Text Field Content Stops Half Way
I've created a flash file which reads an external text file. The text file is constantly updated as its a log of visitors to my website. The dynamic box reads it so far till it meets an '&.' It then stops. Is there a way with actionscript or php to cut out all these &'s?

Dynamic Text Field Height Scaled To Fit Content?
The thread title is pretty self-explanitory... I am wondering if it's possible to get a dynamic text field's height to scale automatically to fit the content inside of it. I've seen some "brute force" solutions of calculating character width and line height, and number of characters per line, but that won't work for me, as I have a variety of CSS-styled text that wll be of varying size and position.

Any ideas? Thanks...

Masking And Scrolling A Text Field Filled With Dynamic Content (FL 5)
*help*
I have a text field that must scroll horizontally. It is filled with content read from an external txt file.
I need to scroll the content within the field cause it is longer than the width of the text box.
this is a single line text field that must scroll a varying distance depending on the length of the imported txt line.
PLEASE help.

If anyone can help i will bake you cookies!
Thanks,

Dynamic Content: Cold Fusion Results Placed Into A Scrollable Text Field
I currently have a scrollable dynamic text field that is being populated from an externally located static text file.

This is the ActionScript that is currently in place; it is taken from the tutorial “Scrolling Dynamically Loaded Text” ( http://www.kirupa.com/developer/mx/dynamic_scroller.asp )

loadText = new loadVars();
loadText.load("StaticTextFile.txt");
loadText.onLoad = function() {
scroller.text = this.VariableName;
};


I need to utilize this scrollable dynamic text field functionality with information passed from Cold Fusion as opposed to a static text file.

I work closely with the Cold Fusion developers so they are confident that they can pass me just about anything I need. The problem is “we” don’t know what exactly that is.

Here is the scenario:

I am building a completely flash help module for one of their web projects. Throughout this module certain “glossary terms” are presented in various locations. When the user clicks one of the “glossary terms” (which have been made into buttons) I target a MC instance to come onto the stage and provide the definition.

You can see what I have built up onto this point here:
http://qc.accelerateu.org/joel/index.html

As it stands now the text for the definition is pulled in from a static text file. It needs to be dynamically generated from Cold Fusion and passed into my flash movie. The definitions for these glossary terms are located in a database as they are used in numerous projects/locations throughout our entire website.

What I need is:

I need a way to set a variable in flash that tells the movie what the source of the content is going to be. I need to pass that variable out of my movie to Cold Fusion then, based on the performed query, have the results sent back into my flash movie and be scrollable depending on the length of the content.
I don’t need to concern myself with anything transpiring on the Cold Fusion side, I just need to know how to send the query from my flash movie and put the results back in.

Any help would be tremendously appreciated! You could very well be saving my job :)

Have a great day,

jOEL

Reseting Dynamic Text Question
Hi everyone,

I am currently making an RPG, and I'm working on the battle system. I have your character on the left, with your HP (hit points, for people who dont know) in dynamic text above you. On the right I have the enemy, with his HP in dynamic text above him. I have your character doing a random amount of damage per hit, a value between 0 and 70. The problem with this is, sometimes the enemies HP gets below 0, into the negatives. I dont want that. Is there any way I can have the enemies HP go to 0 when his health gets to either 0 or below that?

Heres some code that I used:

code: HP=750;
_root.enemyHP=(140);
if(_root.enemyHP<(0)){
_root.enemyHP=(0);
}

code: _root.enemyHP = _root.enemyHP -=random(70);
if(_root.enemyHP<=(0)){
gotoAndPlay("death");
}

Thanks

Reseting The Dynamic Jpgs And Check On Error.
hey guy need help again.
i have this on my button :
on(release){

this._parent.loadImages(this._parent,this._parent. text1.text);
}
this will load the image that is key in the text field.
any idea i can check an error here like:
if i key in the wrong file name i will get a text say "wrong file name.!"
else if correct file name, load the jpgs..

i have this on my reset button:
on(release){
this._parent.text1.text= "";

}
it will reset wht i wrote on the text field.
but i still need to unload all the pics i have uploaded.

any ideas???
thanks..

Select Text File From Dropdown List, Content To Show In Swf Dynamic Text Field
I have a php page where there is a form with a dropdown list of all text files in my site. The name of the dropdown is $filename.

The action script in my swf is this:
loadVariablesNum("<?PHP echo $filename; ?>", 0);

but I get nothing. It displays correctly when I replace
<?PHP echo $filename; ?> with the actual value of $filename, for example:
loadVariablesNum("ui_websites.txt", 0);

Any ideas what I'm doing wrong?

Dynamic Text Field Is Calling The Variable Name Instead Of Variable Content
I'm having a problem getting something to work. I'm sure it has something to do with string variables and my syntax, but can't figure it out.

I have variables named cust1, cust2, cust3, etc. that are being loaded from a text file (these are customer names that will display in a text ticker).

I want a dynamic text field to display the customer names in incremental order, so I created a variable that consists of the string "cust" + a numeric variable called custNumber. At the end of each pass of the movie, custNumber is increased by 1.

var custNumber = 1;
var custName = "cust"+custNumber;

I want the dynamic text field to call the variable custName, but I can't get it to work. It keeps displaying custName as a string ("cust1", "cust2", etc.).

So I created a new variable called scrollText for the dynamic text to call, and made scrollText = custName;. But it does the same as above.

How do I get my dynamic text to call the variable that I create with another variable?

I want my dynamic text field to display the variable cust1, cust2, cust3, which would be "Jones Plumbing," "Smith Electric" etc., but all I'm getting is "cust1", "cust2", "cust3" etc.

Thanks,

Thom

Dynamic Mask Over Dynamic Content Loses Content
I have come across a problem that so far I have no solutions for at all. I have a movieclip which has a dynamic jpeg loaded into it, then the movieclip is being masked. The issue is I need to have the mask that is on top of the movieclip change, but once I make any change to the mask I completely lose the dynamic jpeg that was loaded into the masked movieclip. Is there a way around this at all?

Tween To Content Outside Of Stage
This is more a theoretical question about I project I want to do than a technical question.

Inspiration/similar effect: http://www.jonathanyuen.com/main.html


What I have:
1. A very large image that is deliberately going off the stage (width: 2000px~, height 1000)
2. Empty movieclip outside of the stage that content will be loaded into

What I want to do:
1. When a button is clicked on the main stage, it will fire a tween that will move the
scope of the stage over the image and to the empty movieclip.
2. Effect: it will (hopefully) be like the stage is gliding over the large image until it stops at the empty movieclip's coordinates.

What I've already done:
1. I've downloaded Tweenlite after researching what I want to do
2. I've looked at this example code: Tweenlite.to(mc, 1, {x:1500, y: 1000});

I'm wondering if I'm on the right track and if the effect I want will be produced using
Tweenlite.

Any ideas and/or suggestions would be greatly appreciated.

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

Input Field Multiline> When Dynamic Multil Field Shows That Data From Mysql But No Wr
Hi,

A form with an input field that is multiline and called "description" send data to a MySql database (PHP).
Another Flash page contains a dynamic field that is also multiline and that displays the content entered in the form.
This dynamic field has a vertical scrollbar.
The problem is that the content displayed in the dynamic field DOESN'T wrap at all (the dynamic field is but on MULTILINE) and so you miss all the text that is larger than the dynamic field.
How can I fix this?

Thanks in advance.

Dynamic Content Presented Over All Normal Content
I have a bunch of generated movie clips that I am creating using the duplicate movie clip function.

The problem I am having is the generated clips are covering up content. Are there any options....(I really don't feel like creating both layer a and b dynamically.)


this is how the movie is publishing:

-----layer A----- (generated content)
-----layer B----- (normal non-generated content)
-----layer C----- (normal non-generated content)


this is how i want the movie to publish:


-----layer A----- (normal non-generated content)
-----layer B----- (generated content)
-----layer C----- (normal non-generated content)


thanks for your help,
Reid

Getting MySQL Field Data Into Dynamic Text Field In Flash
Hi, im having some trouble as to how to retreive data from a mySQL database field and putting the values into a dynamic text field in Flash... im quite new to this so any help will be appreciated! thanks.

Tween To Content Size Problem
Hi. I really like the effect on http://www.svizra.com/. It looks like the tween is controlled by a script that takes into account the size of the content.

Can anyone point me in the right direction of a script that can do this or any help files?

I know this site is old so I am hoping it can be done in flash 5.

cheers
mark

Play Tween After The Content Is Loaded.
My site is build up around the "The Best Structure for your Flash Site" tut. (Thank's Mark!). Here's the code I use to load my pages into it's container.

Can anybody help me gettin the showContent-tween to play after my page is loaded?
(In other words, when getBytesLoaded == getBytesTotal.)


Code:
function buttonClick():Void {
_global.page = this.linkURL;
import mx.transitions.Tween;
import mx.transitions.easing.*;
var hideContent:Tween = new Tween(cone.cover, "_height", Strong.easeOut, 0, 340, 0.3, true);
hideContent.onMotionFinished = function() {
var showContent:Tween = new Tween(cone.cover, "_height", Strong.easeOut, 340, 0, 0.3, true);
loadMovie(_global.page, cone.content_container);
}
}
I couldn't figure out where and how to use it.

Cheers

One Text Field Different Content...
Hi -
I have a single text field (dollar_t) that must show a different dollar amount for each button on the stage. No problem - I just wrote a bunch of "onRelease" functions - one for each of the 10 buttons - with the correct amount "hardcoded" in and it looked good. But then the customer requested that he be able to change the dollar amounts with a plain text editor. I know I can bring them in with load_vars but I'd have to make 10 files and 10 load_vars statements (one for each button)

Is there a way I can put all 10 of the dollar amounts on one text file and then when the user clicks a button, the appropriate amount from the text file shows up in the text area "dollar_t" ?

I've followed some threads here but none that I could fully understand and/or adapt to my purposes.

TIA your input.
jl





























Edited: 08/28/2007 at 02:40:27 PM by jlucchesi

[F8] MySQL Field Value Into Dynamic Text Field In Flash
Hi, im having trouble as to how to retreive a value in a field of a MySQL database and putting it into a dynamic text field in flash... i have no idea as how to do this... any help? thanks

Asp Database Field Loaded Into Dynamic Text Field -HELP
Hi all,
after much trial and error and still having troubles i thought i would ask people that maybe know what there doing.
Im using Flash 8 pro, and have placed textarea component on stage and gave it an instantce name, need to pull a single record from a record database using asp.

This is my approach but if there is an even easier way let me know.

I have created the following pages.
webpage.asp (end result web page that shows the text field to user)
script.asp( asp script that sends data back/forth to flash

i used the FlashVars param to pass a variable into the flash movie.
variable is named auto_num. im using this to then pass it back out of flash to filter the recordset.

then on the flash movie.swf. all on root level. i have the following code

var text_value; //(this is the value sent back from asp page string)
//not sure if i needed to declare it but did anyways.

var_sender = new LoadVars();
myData = new LoadVars();

var_sender.auto_number = auto_num //(auto_num is loaded flashvars param)

myData.onLoad = function() {
my_text_1.text = this.text_value
};
myData.sendAndLoad("http://www.********.com/script.asp", myData ,"POST");

on the script page i have a record set that filters for form variable named auto_number. all of code is in asp. I call a response.write to write the text_value back to the flash movie.

here is the heart of the script.asp code. not showing the record set filtering stuff.

<% Dim text_value
text_value = "text_value="&(Recordset1.Fields.Item("long_des"). Value)

response.write(text_value)
%>

but i get undefined and can never get the variables to load into the flash movie. i want to export as flash player 6 or 7. what am i doing wrong here?

So in a nutshell, i have an asp page that shows a record and would like to display the long description field of that record in a flash dynamic text box.

I can make it work by passing the entire long description from record set within the flashvars param but that seems like a real clunky way to do it pasing that much text within the flashvars param.

Does anyone know of simple database connectivity kits that extend flash for the semi-programmer guys?

Content Manageble Disclaimer Field
Hi,

I'm working on a disclaimer in flash. Now is my problem that the text in the flash movie has to be changed from the outside (content management). Is this possible.. and if yes, how?

Greetz,

Graveman

Formatting HtmlText Field With XML Content
Hello once again everyone,

Within a movie clip I have several text fields, all of which are populated from an XML file. I'm attempting to format some of the fields based on the status of other XML line items. This population function exists in a loop. It basically looks like this:


ActionScript Code:
if(xmlList.Highlight[b] == xmlList.itemID[b]){
                _mc.itemName.htmlText = '<b>'+xmlList.itemName[b]+'</b>';
            } else {
                _mc.itemName.htmlText = xmlList.itemName[b];
            }

I have all the fields populating, but the text is not formatted properly, i.e. not displaying bold text when selected for highlighting by the XML file. I'm not entirely sure what I'm doing wrong...

Can you help? Thanks in advance as always!

Text Field Content Check
Hi

Does anyone know what would the code look like if I want to check whether anything had been loaded into a text field or if it's empty?

Thanks

Text Field Content Check
Hi

Does anyone know what would the code look like if I want to check whether anything had been loaded into a text field or if it's empty?

Thanks

Change Field Content With 'switch'
ActionScript Code:
btn1.onPress = function() {
    switch(_root.chk1.selected) {
        case true:
            _root.mytext = "true";
        case false:
            _root.mytext = "false";
        default:
            _root.mytext = "default";
    }
    lbl1.text = _root.mytext;
    trace(_root.chk1.selected);
 
}


Hello, I have a button component (btn1) on the stage, lbl1 is a label. Clicking on the button, the label content is always 'default', whether or not the checkbox (chk1) is selected. Tracing is ok instead.

Thank you very much,
m.

Change A Text Field's Content
Greetings

I am trying to find a way to have an input text field automatically clear its self of the default text it is displaying when the user clicks on it to enter new data - much alike the login on the forum page here at ultrashock.

This way they do not have to select and delete, or use backspace before they can begin typing the new content.

Any suggestions?

Another Text Field Tween Problem
Hi,

I can't get a text field to alpha tween. Looked on here for answers and tried putting the text field in a container movie clip as recommended in one post - the container tweens but not the text field.

It's suppose to be easy.

The text field is created by calling the class in Actionscript 3, and the content is loaded from an XML file and styled with CSS.

Any help appreciated.

Here's the code with the tween applied directly to the text field:

// create an instance of the TextField class
var homeTextField_txt:TextField = new TextField();.....


.....// add the text content to the text field
homeTextField_txt.htmlText = contentHomeTextField_txt;

// add a fade in for the text
var text_tween:Tween = new Tween(homeTextField_txt, "alpha", Strong.easeIn, 0, 1, 1, true);
// display the text field
addChild(homeTextField_txt);

[AS2] - Alpha Tween On A Text Field
Hey guys. I have run into this problem multiple times and never been able to find an answer, but this time rather than doing a work around, I wanted to try once-and-for-all to see if anyone has an answer.

With actionscript I'm creating a new movieclip, then having that movieclip create a text field. I'm populating this text field with content pulled from an XML file, and also controlling its color, size, ect. with the same XLM document.

I'm trying to set its alpha to 0, then have Tweener tween it in to 100, but have never been successful.

Has anyone run into this and found a way to do it?

I have also looked into TweenLite, and TweenMax as other options, but nothing seems to be able to do it...

Any help would be much appreciated. Thanks!

Tracking Input Text Field Content
Just a few questions about getting info from input text fields.

1. I want to scan a text field and find the poistion of a particular word is this possible (eg find Bold in "This is Bold" or "Bold is good" - I want to find its position in either sentence.


2. Is it possible to search for a word in a sentence and change it to another (ie find 'bold'and change it to 'normal')

3. Can I detect whether a word has a captial letter within a sentence.

4. Can I detect whether a word is followed by puntuation.

Many thanks in advance
Oll

Having HTML Content Inside A Text Field
how can i have html content inside a flash file, particulalry inside text field? i can't use xml, since i don't know how, and since school doesn't want to use xml...

can anyone help?

Content Of A Single Line In A Text Field
I am loading a hundred string values from a text field (each with a <br> after them) into a multiple line Dynamic text field set to display html. When a user clicks on any one of the lines, I want the content of that line only to be set into a variable for further processing.
any ideas on how to do this simply assuming that the loaded in data will be changing quite often?
thanks

Emptying Text Field In A Function Before A Tween
With a bit of help, I have a slideshow gallery that externally loads images. There's buttons at the bottom left and when you press one a new externally loaded image loads up (the old image fades out and the new one fades in). The title (a Textfield) of the image aligns to the bottom right of the image and I have a listener that automatically finds out what the width of the image being loaded is, that gets put in a variable and that variable is then used to change the x position of the title textfield and thus align it to the right of the image (as the images are of different widths).

It all works okay, but I want the textfield to be empty as soon you press the button, the tween to happen and then the new text/title to appear. At the moment the text shows the old title, then the tween happens and then the new title comes up.


Ermm.. does this make sense? I'm a newbie!

Any thoughts would be most welcome...


Here's some code

import mx.transitions.Tween;
import mx.transitions.easing.*;

this.createEmptyMovieClip("container_mc",this.getN extHighestDepth());
this.createEmptyMovieClip("buttons_mc1",this.getNe xtHighestDepth());
this.createEmptyMovieClip("buttons_mc2",this.getNe xtHighestDepth());
this.createEmptyMovieClip("buttons_mc3",this.getNe xtHighestDepth());

var mywide:Number;
var clipList:Object = new Object();
var clipLoad:MovieClipLoader = new MovieClipLoader();
clipLoad.addListener(clipList);


clipList.onLoadInit = function(target:MovieClip) {
trace(" width = "+ target._width+" height = "+ target._height);
mywide = (target._width-mytext._width);
setX();
}


buttons_mc1.attachMovie("one","one_mc",buttons_mc1 .getNextHighestDepth());
buttons_mc1.one_mc._x = 1;
buttons_mc1.one_mc._y = Stage.height-buttons_mc1.one_mc._height-2;


buttons_mc2.attachMovie("two","two_mc",buttons_mc2 .getNextHighestDepth());
buttons_mc2.two_mc._x = 10;
buttons_mc2.two_mc._y = Stage.height-buttons_mc2.two_mc._height-2;

buttons_mc3.attachMovie("three","three_mc",buttons _mc3.getNextHighestDepth());
buttons_mc3.three_mc._x = 20;
buttons_mc3.three_mc._y = Stage.height-buttons_mc3.three_mc._height-2;



function setX(){
mytext._x = mywide;
mytext.text = newText;
mytext.setTextFormat(myTextFormat);
};




function setNewText(){
mytext.text = newText;
mytext.setTextFormat(myTextFormat);
};






_root.createTextField("mytext",105,125,428,300,100 );

var newText = "TITLE ONE"
mytext.text = newText;
trace(mytext);

mytext.embedFonts = true;

myTextFormat = new TextFormat();
myTextFormat.font = "Arial";
myTextFormat.size = 11;
myTextFormat.color = 0x000000;
myTextFormat.align = "right";

mytext.setTextFormat(myTextFormat);


textInstance.setTextFormat(myTextFormat);


clipLoad.loadClip('1.jpg',container_mc);

function fadeIn() {
var MyfadeIn = new Tween(container_mc, "_alpha", Strong.easeOut, 0, 100, 36, false);
}

function fadeOut() {
var MyfadeOut = new Tween(container_mc, "_alpha", Strong.easeOut, 100, 5, 20, false);
}



buttons_mc1.one_mc.onRelease = function() {
newText = "TITLE ONE"
setNewTex()
new Tween(container_mc, "_alpha", Strong.easeOut, 100, 0, 20, false).onMotionFinished = function() {
clipLoad.loadClip('1.jpg',container_mc);

newText = "TITLE ONE"
setNewTex()
fadeIn();


};

};








buttons_mc2.two_mc.onRelease = function() {

new Tween(container_mc, "_alpha", Strong.easeOut, 100, 0, 20, false).onMotionFinished = function() {
clipLoad.loadClip('2.jpg',container_mc);
fadeIn();

fadeIn();
newText = "TITLE TWO"
setNewTex()

};
};





buttons_mc3.three_mc.onRelease = function() {

new Tween(container_mc, "_alpha", Strong.easeOut, 100, 0, 20, false).onMotionFinished = function() {
clipLoad.loadClip('3.jpg',container_mc);
fadeIn();

fadeIn();
newText = "TITLE THREE"
setNewTex()

};
};

Dynamically Resizing A Text Field To Content And Scroll If Beyond ScreenResolutionY
Day 4 researching this and still trying to see if there were a way for me to have scroll bars appear for my auto size text field if the content were to go beyond the viewable area. This would regard screen resolution I guess?
So if viewers were on a smaller screen size the scroll bars would appear, but no scroll bars for people on large monitors. I am aiming for a design that will be effective for most resolutions.
The best exmple of it I have seen is here choose PRESS then check out the way Biography resizes.
Hope I am clear.
I am mindful that I may be biting off more than I can chew but I would really love to add this functionality to my design.
Apprecite any ones ideas

Dynamic Text Field And Dynamic Xml Field
Good evening,

After days of debugging, I find myself cornered by identifying the absence of content in a dynamic xml field.

I am trying to build a function that will move the playhead to a new frame "waiting" when the field is undefined. When the field is populated, the playhead will move to an active frame "vote".

I have attempted several variations on the following code and nothing has worked as of yet.

if (_root.mc_xml.b1v.text=="") {
trace("waiting");
} else if {
trace("vote");
}

// never got it to print anything but vote

There are five possible strings that can dynamically populate b1v from the xml: "Aye", "Nay", "Abstain", "Absent", "NP".

When the vote is complete the xml nodes and their children disappear and flash sees the xml text field as undefined.

What is the correct AS to target or check for null or undefined?

is null
=null
!=null
=undefined
is undefined
!=undefined

I just need a boolean answer. Please someone release me from this loop.


Thanks

Loading External .txt File Content In A Movie Clip Or Text Field
My client wants to change the content of his page himself, but he doesn't have Flash MX. Can I somehow make that movie clip or text field content to be loaded from an external .txt file?
thanx

Dynamic Field Vs Input Field
whats the question?

Dynamic Window Shopping Using Tween Class : Unable To Load Dynamic Data
hi guys, i am a newbie here and in flash too. I've learnt ActionScript basics from this forum and i hope i get a solution for my problem.I am doing this window shopping gallery for my company but iam stuck in the middle of nowhere.I am attaching the files so that u can have a look at it. the gallery is xml driven.
when a user hovers to the left side of the gallery tween starts and the stores move in a perspective angle. i am placing the code here for xml loading which is in 1st frame

ActionScript Code:
stop();
var tracker:Number = 0;
var total:Number;
var totProd:Number;
var storeId:Array = [];
var storeName:Array = [];
var storeLogo:Array = [];
var storeDesc:Array = [];
var pcode:Array = [];
var price:Array =[];
var pdesc:Array =[];
function loadXML(loaded) {
    if (loaded) {
        rootNode = xmlData.firstChild;
        total = rootNode.childNodes.length;
        //trace("total "+total+" stores");
        //trace("-------------------------Description---------------------");
        for (i=0; i<total; i++) {
            storeId[i] = rootNode.childNodes[i].attributes.sid;
            storeName[i] = rootNode.childNodes[i].attributes.sname;
            storeLogo[i] = rootNode.childNodes[i].attributes.slogo;
            storeDesc[i] = rootNode.childNodes[i].attributes.sdesc;
            totprod = rootNode.childNodes[i].childNodes.length;
            //trace("Store ID : "+storeId[i]);
            //trace("Store Name : "+storeName[i]);
            //trace("Store Logo : "+storeLogo[i]);
            //trace("Store Desc : "+storeDesc[i]);
            //trace("Products in Store : "+totprod);
            for (j=0; j<totprod; j++) {
                pcode[j] = rootNode.childNodes[i].childNodes[j].attributes.pcode;
                price[j] = rootNode.childNodes[i].childNodes[j].attributes.price;
                pdesc[j] = rootNode.childNodes[i].childNodes[j].attributes.pdesc;
                //trace("Product Code : "+pcode[j]);
                //trace("Price : "+price[j]);
                //trace("Product Desc : "+pdesc[j]);
            }
            //trace("______________________________________________________");
            //trace("------------------------------------------------------");
        }
    } else {
        trace("unable to load XML file");
    }
}
_root.prloadr_mc.onLoad = function() {
    total = getBytesTotal();
};
_root.prloadr_mc.onEnterFrame = function() {

    loaded = getBytesLoaded();
    if (loaded>=total) {
        _root.gotoAndStop(2);
    }
};
var xmlData:XML = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("windowshopping.xml");


and in the second frame the code is as follows:


ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
_root.store1_mc.dyn_txt.text = tracker;
_root.store2_mc.dyn_txt.text = tracker+1;
_root.store3_mc.dyn_txt.text = tracker+2;
_root.store4_mc.dyn_txt.text = tracker+3;
var initial:Boolean = true;
_root.enter_mc._visible = false;
_root.backward_btn.useHandCursor = false;
var t1:Tween = new Tween(_root.store1_mc, "_x", None.easeNone, 645.7, 1394.1, 1.5, true);
t1.stop();
var t2:Tween = new Tween(_root.store1_mc, "_y", None.easeNone, 363.9, 335.7, 1.5, true);
t2.stop();
var t3:Tween = new Tween(_root.store1_mc, "_width", None.easeNone, 548, 1009.2, 1.5, true);
t3.stop();
var t4:Tween = new Tween(_root.store1_mc, "_height", None.easeNone, 644.4, 1186.5, 1.5, true);
t4.stop();
var t5:Tween = new Tween(_root.store2_mc, "_x", None.easeNone, 240.9, 645.7, 1.5, true);
t5.stop();
var t6:Tween = new Tween(_root.store2_mc, "_y", None.easeNone, 379.8, 363.9, 1.5, true);
t6.stop();
var t7:Tween = new Tween(_root.store2_mc, "_width", None.easeNone, 298.4, 548, 1.5, true);
t7.stop();
var t8:Tween = new Tween(_root.store2_mc, "_height", None.easeNone, 350.8, 644.4, 1.5, true);
t8.stop();
var t9:Tween = new Tween(_root.store3_mc, "_x", None.easeNone, 15.7, 240.9, 1.5, true);
t9.stop();
var t10:Tween = new Tween(_root.store3_mc, "_y", None.easeNone, 390.1, 379.8, 1.5, true);
t10.stop();
var t11:Tween = new Tween(_root.store3_mc, "_width", None.easeNone, 174.3, 298.4, 1.5, true);
t11.stop();
var t12:Tween = new Tween(_root.store3_mc, "_height", None.easeNone, 188.8, 350.8, 1.5, true);
t12.stop();
var t13:Tween = new Tween(_root.store4_mc, "_x", None.easeNone, -113.7, 15.7, 1.5, true);
t13.stop();
var t14:Tween = new Tween(_root.store4_mc, "_y", None.easeNone, 394.9, 390.1, 1.5, true);
t14.stop();
var t15:Tween = new Tween(_root.store4_mc, "_width", None.easeNone, 95.9, 174.3, 1.5, true);
t15.stop();
var t16:Tween = new Tween(_root.store4_mc, "_height", None.easeNone, 103.8, 188.8, 1.5, true);
t16.stop();
function myTween() {
    t1.start();
    t2.start();
    t3.start();
    t4.start();
    t5.start();
    t6.start();
    t7.start();
    t8.start();
    t9.start();
    t10.start();
    t11.start();
    t12.start();
    t13.start();
    t14.start();
    t15.start();
    t16.start();
}
function myTweenRepeat() {
    _root.store1_mc.dyn_txt.text = tracker;
    _root.store2_mc.dyn_txt.text = tracker+1;
    _root.store3_mc.dyn_txt.text = tracker+2;
    _root.store4_mc.dyn_txt.text = tracker+3;
    t1.start();
    t2.start();
    t3.start();
    t4.start();
    t5.start();
    t6.start();
    t7.start();
    t8.start();
    t9.start();
    t10.start();
    t11.start();
    t12.start();
    t13.start();
    t14.start();
    t15.start();
    t16.start();
}
function myTweenStop() {
    trace("Stopped");
    t1.stop();
    t2.stop();
    t3.stop();
    t4.stop();
    t5.stop();
    t6.stop();
    t7.stop();
    t8.stop();
    t9.stop();
    t10.stop();
    t11.stop();
    t12.stop();
    t13.stop();
    t14.stop();
    t15.stop();
    t16.stop();
}
function myTweenResume() {
    trace("Resumed");
    t1.resume();
    t2.resume();
    t3.resume();
    t4.resume();
    t5.resume();
    t6.resume();
    t7.resume();
    t8.resume();
    t9.resume();
    t10.resume();
    t11.resume();
    t12.resume();
    t13.resume();
    t14.resume();
    t15.resume();
    t16.resume();
}
_root.forward_btn.onRollOver = function() {
    if (initial) {
        trace("Initial");
        myTween();
    } else {
        trace("Resuming...............");
        myTweenResume();
    }
    t1.onMotionFinished = function() {
        tracker++;
        trace("Repeat");
        myTweenRepeat();
    };
    _root.forward_btn.useHandCursor = false;
    _root.leftarrow_mc._visible = false;
    _root.enter_mc._visible = true;
    _root.enter_mc.gotoAndPlay("s2");
    _root.tooltip_mc.gotoAndPlay("s1");
    initial = false;
};
_root.forward_btn.onRollOut = function() {
    myTweenStop();
    _root.leftarrow_mc._visible = true;
    _root.tooltip_mc.gotoAndPlay("s2");
    _root.enter_mc.gotoAndPlay("s1");
};


the problem is, I cant change content in store dynamically.
please anyone help me out from this situation. i will be waiting for replies.
Thanks in advance.

Dynamic Text : Dynamic Height (depending On Content)
Hi people.

Im working on a website, and in some part there is a dynamic text space that sets its width depending on the resolution.

But well, I want the text to be sitting downside of my webpage. For this (I guess) I need to set the height of the space to its contents, so that I can use the textspace height as a unit, for putting it to the ground
(myTextSpace.y=stage.StageHeight - myTestSpace.height)

But well, I do not know, if there is any way to set the textspace height to its contents.

I hope I'm clear, thank you.

Flash Dynamic Menu W/ Dynamic Content
I have been working on this project for school where when you run the flash on a server it uses loadvariables() to open a php file that lists all of the text files of a directory 'pages' in variable format for flash to build a button per text file. To clarify:

/pages
-home.txt
-tuts.txt
-links.txt

flash builds buttons for each of these above files with the button named after the text file name (minus the .txt).

This works just fine but what I want to do now is say, when you click the home button, it will load the contents of pages/home.txt into a dynamic text box. Or when you click the pages/tuts.txt it loads that, etc.

So far, I can get the text box to display the location of the text file based on what button you pushed but i cant get it to display the text that is in the text file. I know that i am inches away from finishing it but I can't seem to figure out where to place what code. I've tried many dynamic text tutorials and none seem to go into detail about stuff like this. They all just talk about a text box and loadvar's in the same frame in the same mc, etc.

If anyone can give me some help, I would greatly appreciate it. Thanks.

Here is my working example. http://mungyun.com/experiments/close/dyn_menu.html

here is a zip file with my work to this point. You need a php enabled server to get this to work.
http://mungyun.com/dynmenu.zip

Dynamic Text Field Receiving Dynamic Variables...
or something like that . . .

This is my problem: I'm generating _global variables via XML. Each variable represents different types of copy, of varying lengths. For Example:

_global.introduction = xmlDoc_xml.firstChild.firstChild.nodeValue;
_global.body = xmlDoc_xml.firstChild.firstChild.firstChild.nodeVa lue;
_global.summary = xmlDoc_xml.firstChild.firstChild.firstChild.firstC hild.nodeValue;

I want to create ONE text field, with scrolling, that will act as a template to house all types of content. I've assigned a variable that equals "content" to this text field. . . My problem is, I can't get the text field variable (content) to dynamically swap for the global variable (_global.introduction) in order to display the proper content.

This seems simple, but something's not working for me. Any thoughts? . . . BIG thanks in advance!

Copyright © 2005-08 www.BigResource.com, All rights reserved