Dynamic Text in script
Hi,
I want to display some text in a script window dynamically.
Is it possible to have a dynamic window in script.
Please help in this regard.
Thanks & Regards,
Rajesh
Hi,
All you can do is to put any condition while calling that window with that element.
To ways to achive this.
1. In your print program put any condition while calling WRITE_FORM.. Like below:
if condition 1 = 'True'.
call function 'WRITE_FORM'
exporting
element = 'TEXT'
window = 'DYNAMIC_TEXT'
exceptions
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
others = 7.
endif.
2. Or Just in the script editor in that window , put any if condition to print that text. It means it will print your text only when any condition is setisfied.
/: IF &CONDIITION& = 'TRUE'
PF &ZZ_TEXT_TO_BE_DISPLAY&
/: ENDIF
Reg,
Lokesh.
Similar Messages
-
Positioning dynamic text in SAP Script windows
HI all,
Is there any control command to position DYNAMIC text that comes from a variable into a window...
Regards,
Chandra SekharHi chandra,
You can move the text into one variable in the print
program and in the layout form call this as
&VAR&.
Thanks&Regards,
Siri. -
Using dynamic text in Flash Builder
Hi,
I'm trying to get some dynamic text to my web page. The text is readed from .txt file
I use AS script which i was using in a project I made with Flash Pro and now i try to implement it in Flash Builder project
The script look like this:
var req:URLRequest = new URLRequest("design_1.txt");
var loader:URLLoader = new URLLoader();
function textLoaded(event:Event):void
design.text = loader.data;
loader.addEventListener(Event.COMPLETE, textLoaded);
loader.load(req);
So first I made a project with Flash Catalyst and in there I created an area text element. Then I imported the project to Flash Builder and put the AS script in the <Script> section and gave the <RichText> an id="design". The text is just simple text and formatting happens in richtext element.
So, when i try to compile the FB project it give me and parse error "undefined property error req", "undefined property error loader" etc.
So should i alter the AS script for FB or is there something else wrong? I tried to google how to use dynamic text in FB but couldn't find any easytyutorials. I'm mostly a desginer so coding isn't my speciality. But thanks for help!Hi Amy,
You can customize 'New class' generation under Preferences->Editors->Flash
Builder->FileTemplates->Action Script->New ActionScript class.
Currently there are no template variables available constructors. But you
can customize it as following,
$
${import_declaration}
$ {
public function ${class_name}() { -
Targeting Dynamic Text Box inside moviecip with variable
Hi,
How does one target a dynamic text box to change the border
color inside of a movie clip? Example below which does not work
theName = ("answerPrint" + arryCount);
boxName = ("box" + (arryCount+1));
_root.pagePrintPartA[theName][boxName].border = true;
_root.pagePrintPartA[theName][boxName].borderColor =
0x00cc66;Thanks for the reinforcement, but I should of indicated what
was what:
theName = ("answerPrint" + arryCount);// Name of Variable
inside Dynamic Text Box Inside MovieClip
boxName = ("box" + (arryCount+1));// Instance Name of Actual
Dynamic Text Box Inside MovieClip
_root.pagePrintPartA[theName][boxName].border = true;
_root.pagePrintPartA[theName][boxName].borderColor =
0xFF0000;
By certifying this script you showed me wher I went wron (not
seeing the forest from the trees). The last two lines should be:
_root.pagePrintPartA[boxName].border = true;
_root.pagePrintPartA[boxName].borderColor = 0xFF0000;
I was targeting backwards. Thanks alot DazFaz. -
Using loadVariables() to populate a Dynamic Text in a MovieClip
Hello everyone,
I am trying to populate a Dynamic Text with data from a
remote database. I have no problem populating the Dynamic Text with
the data from the remote database if the Dynamic Text is placed in
the main timeline using the following code.
loadVariables ("php/attorney.php", "");
Once I move the Dynamic Text into a Movie Clip with instance
name of “MC_But_1” I am only able to populate the
Dynamic Text if I place the above code in the movie clip. Since it
is going to take sometimes for the data to be transferred from the
remote database I rather to do this on the main timeline before the
MC_But_1 is shown. I have used the following code but for some
reason it is not working.
loadVariables ("php/attorney.php", _root.MC_But_1);
Can someone be kind enough to tell me where I am going wrong?
Thank you very much and have a great day.
Khoramdin> Since it is going to take sometimes for the data to be
> transferred from the remote database
That is one of the best arguments for abandoning
loadVariables() in
favor of LoadVars(). Check that out in the manual. It's
better because
there are events that get triggered when a data transfer has
completed
and you can write an event handler script to deal with server
responses.
Christian Scholz-Flöter -
Dynamic Text getting messed up
I have a "Dynamic Text" element called "output_txt". In my action script code, I have this line:
output_txt.text = "I am thinking of a number between 1 and 100";
But what actually gets displayed in that element, after that line runs is:
"thinin o ne etween n 00"
Some of the letters are randomly getting dropped. Any ideas on what could be going wrong?
(I'm using Adobe Flash Professional CS5.5 version 11.5.0.325.)Thanks for the answer. I was actually using "classic text", and I had clicked the embed font button. But I when checking it again, I notice that you have to select a character range or nothing actually gets embedded. Clicking "all" under the character range resolved the issue.
-
Dynamic text in different movie clip
Inside scene one i have a movie clip that contains a movie
clip that contains a dynamic text field. Also inside Scene one I
have a different movie clip that contains a movie clip that
contains a movie clip that contains a input text field. And I need
for the user to type in to the input text field and see what they
are typing show up in the dynamic text field. What would that
script look like and where would I put it? Can anyone help
please?hi!
Lets say you have your dynamic clip on the same level as the
movieclip containing your input field.
_root.dynamic_texfield_name.text =
_root.name_of_movieclip.input_texfield_name.text;
If you need the dynamic textfield to be updated as soon as
the user types something in the input field you can use a onChange
handler.
_root.name_of_movieclip.input_texfield_name.onChange =
function(){
_root.dynamic_texfield_name.text =
_root.name_of_movieclip.input_texfield_name.text;
} -
Dynamic text in looping movie clip
Hi,
I am looping a movie clip which has a dynamic text box. I
need to call data from XML and place the same in the Dynamic text
box as per the duplicated movie clip. how do i do that.
Thanks,
Ayushon (release) {
_parent.frontFields.topTextArch.ph2TopTextBrush._visible =
false;
That is the script attached to my button. I can see the text
flash for a second when I push the button but it does'nt go away
because the looping movie clip just continually goes back to the
first frame and makes the ph2TopTextBrush text field visible again.
I think I know what your saying. Your saying to attach a
script to the first frame of the looping movie clip that would
check to see which of the 3 dynamic text fields are visible. That
would be perfect but I'm not sure how to do it.
What would the script that I place on my button look like?
What would the script in the first frame of the looping movie clip
look like? -
Cannot use text:TextField with dynamic text in 3.2
Hi,<br /><br />I have a multi-lang app which uses English LTR and Hebrew-Arabic RTL.<br />I am using a properties file for each language, and I get the<br />right item using resourceManager getString.<br /><br />Until 3.2 I had to reverse the order of the words in each item when using<br />Hebrew (or Arabic for that matter).<br /><br />In 3.2 with the new Text layout framework, this is not needed (MAJOR IMPROVEMENT) but I cannot get it to work with dynamic text only static text.<br /><br />of course all works great if I upgarde to flex 4.0, and use the textBox component, but I do not want to do that, so late in the development phase of the application.<br /><br />Here is a small mxml which shows the problem:<br /><br /><?xml version="1.0" encoding="utf-8"?><br /><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"<br /> xmlns:TryComps="appComponents.*" xmlns:text="flash.text.*"><br /> <mx:Style source="css/flashTypeStyles.css"/> <br /> <mx:Script><br /> <br /> import mx.resources.ResourceManager;<br /> <br /> </mx:Script><br /> <mx:Label text="Using text:TextField FIXED : THIS WORKS"/><br /> <!-- some text in hebrew if you dont see it you probably dont have it insalled --><br /> <text:TextField text="עברית כותבים מימין לשמאל"/><br /> <mx:Label text="Using text:TextField DYNAMIC : THIS DOES NOT WORK"/><br /> <text:TextField text="{resourceManager.getString(Locales.LOCALE_BUNDLE,'BI_DIRECTIONAL_TEXT')}"/><br /> <br /></mx:Application><br /><br />Any one has an idea ???<br />The 'BI_DIRECTIONAL_TEXT' is an entry in the property file which has the same value as the static text above.<br /><br />The run time error I get is : <br />TypeError: Error #2007: Parameter text must be non-null.<br /><br />Thanks<br /><br />Eli7
If you look thru the TextField class in the help documents you will find all of the properties you can manipulate. One property is the wordWrap property which will keep you text from going off the side of the textfield. Another is multiline which will allow the textfield to have more than one line. And another is the autoSize property which will make your textfield adjust to fit the amount of text loaded into it.
-
ok i am at the last part of my project. it worked all well and reads all text fields from a text file as seen on :
http://www.myblueranch.com/index2.html
now i am trying to get the same thing working from MYSQL.
Notice that the text file i used for index2.html is called
www.myblueranch.com/trees1.txt
and it was a direct copy/paste from the php page that gave the results from the MYSQL query. (the php query page is:)
www.myblueranch.com/flash_names.php
The problem is i am getting an error in
www.myblueranch.com/index.html
which uses the php to get the text for the dynamic fields.
I get the following error:
TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at final_fla::MainTimeline/onDataLoad()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
my flash movie has 113 buttons called button_1 --> button_113 and 113 dynamic text fields tcname_1-->tcname_113
my AC3 code is the following:
// button links: to all buttons to open in iframe 'tdes'
// link corrosponds to button number
// i have 113 buttons.
for(var i:int=1;i<=130;i++){
if(this["button_"+i]){
this["button_"+i].addEventListener(MouseEvent.CLICK,f);
function f(e:MouseEvent):void{
var n:String=e.currentTarget.name.split("_")[1];
navigateToURL(new URLRequest("ranch.php?id="+n),"tdes");
// end of button links
//Create the URLLOader instance
var myLoader:URLLoader = new URLLoader()
//the data will come as URL-encoded variables
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES
//Load using an URLRequest, even beeing local
myLoader.load(new URLRequest("flash_names.php"))
//onLoad handler listener
myLoader.addEventListener(Event.COMPLETE, onDataLoad)
//Error handling
myLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError)
myLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError)
//Could be an error or just a message
myLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus)
//add a listener for the complete event
function onDataLoad(evt:Event){
trace(evt.target.data.cant);
for(var i:uint=1; i<evt.target.data.cant; i++){
this["tcname_"+i].text = evt.target.data["tcname_"+i]
this["tcname_"+i].autoSize="left"
this["tcname_"+i].multiline = true;
this["tcname_"+i].wordWrap = true;
this["tcname_"+i].width = 70;http://forums.adobe.com/post!input.jspa?container=2066&containerType=14
this["tcname_"+i].visible = false;
this["button_"+i].addEventListener(MouseEvent.ROLL_OVER, buttonover);
this["button_"+i].addEventListener(MouseEvent.ROLL_OUT, buttonout);
trace(i);
// ON ROLLOVER make text field visible and change color
function buttonover(e:Event){
var tf:TextField=TextField(this["tcname_"+e.currentTarget.name.split("_") [1]]);
trace (tf.name);
tf.visible = true;
tf.textColor=0xff0000;
// ON ROLLOVER make change color and make invisible
function buttonout(e:Event){
var tf:TextField=TextField(this["tcname_"+e.currentTarget.name.split("_") [1]]);
tf.textColor=0x000000;
tf.visible = false;
//error callbacks
function onIOError(evt:IOErrorEvent){
trace("IOError: "+evt.text)
function onHTTPStatus(evt:HTTPStatusEvent){
trace("HTTPStatus: "+evt.status)
function onSecurityError(evt:SecurityErrorEvent){
trace("SecurityError: "+evt.text)Kenneth this created another problem:
1- i changed the code of the php to make it look like:
&tcname_1=Cherokee SweetGum&tcname_2=cedar&tcname_3=cedar&cant=3
and now i get this error:
Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables()
at flash.net::URLLoader/onComplete()
Also when i do that even when i load from a textfile (i.e. not from MYSQL through php) i see no text at all!!
2- Where did you want me to put these trace lines? if i put them in the end of my ac3 script i get this compile error:
Scene 1, Layer 'Layer 1', Frame 1, Line 97
1120: Access of undefined property evt.
did i do something wrong? -
Scrolling text / Dynamic text Box
Hi guys,
Hopefully someone can help me. I am quite new to flash and
scripts so excuse my stupidity..!!! I am creating a media player
(CS3), and have almost finished it except on small thing that is
driving me round the twist.
I have a few dynamic text boxes that take info from id3 tag
of the mp3 file and I want to make the info inside the boxes scroll
as ideally some of the information will be longer that the text
box.
The code to populate the boxes is:
function id3Handler(evt:Event):void {
songInfo.text = song.id3.artist;
songName.text = song.id3.songName;
album.text = song.id3.album;
I have set the boxes to be scrollable but nothing happens,
hopefully this will be simple for someone to me.
Thanks in advance.Just bumping this back up. I'd really like to figure this one
out -
Dynamic text - newbie question
hello,
i'm reviewing a lesson on Lynda.com. The subject is loading
dynamic text from an external text file. Every time I try to access
the dynamic text i've placed on the stage, I get an error: "Cannot
access a property or method of a null object reference."
I have two layers. Display and Actions. (Actions at the top.)
The display layer has a keyframe in frame 1. on it, is a large
instance of dynamic text. The instance name I've given it is
"external_txt".
Actions has a keyframe. In this frame i've got Lynda's action
script, which is:
var textLoader:URLLoader = new URLLoader();
var textReq: URLRequest = new
URLRequest('text/htmlText.txt');
function textLoaded(event:Event):void
external_txt.text = textLoader.data;
textLoader.load(textReq);
textLoader.addEventListener(Event.COMPLETE, textLoaded);
in frame 2 of the Actions layer, I have a single command:
stop();
When I run this I can never assign a value to my dynamic
text. Even if I try:
function textLoaded(event:Event):void
external_txt.text = 'smith';
// external_txt.text = textLoader.data;
--I get the error about the null object reference. For some
reason I can not get my AS to set a property to the dynamic text on
my stage.
my publish settings are AS 3.0.
does anyone have an idea what i'm doing wrong? Thanks.hi Ned,
you've helped me again. Thanks.
Putting stop in the first frame makes it now work. I don't
really understand why, though.
I had a 'stop' in frame 2 of my actions layer. so, when i ran
what I started out with, with 'stop' in frame 2, when the playhead
reaches frame one why can't I assign a value to the dynamic text
instance?
thanks. -
Dynamic Text - partially working
If anyone is willing to assist me with this, it would be
greatly appreciated.
I've created an interactive animation. On load, a number
appears in the dynamic text box. When button one is pushed, the
number needs to change; when button two is pushed, the number needs
to 'clear' - be replaced by '-.-'.
The '-.-' shows up; the second number does not. For
reference, in the code below, the 4.5 is in temp_txt on load; when
the minmax_btn is pressed, no numbers show up in min_txt or
max_txt; when the reset_btn is pressed, the '-.-' shows up in
min_txt and max_txt.
What have I got wrong in here?It's me again...
Here is a simplified version of my code which doesn't change
the result but which is only using recognized properties in AS2 (I
got rid of "viewableRows" which was questionable...)
The only problem is:
How to make the second (or the third, the fourth, etc) page
start printing at line (row) 81 instead of 20?
I think the script "believes" that it must print 80 lines
whichever the text is.
To do so, it prints the FIRST 80 lines on page one then it
prints the LAST 80 lines of the text.
Is it a schizo script? :-)
Gerry
In real world, printFld has fixed dimensions (525, 650) and
is automatically populated by other functions (text is always the
result of a search and the search functions automatically format
the text and send it to this field) -
I have created a RSS feed viewer, parsing the RSS feed with
actionscript 3.0 and viewed on the stage in dynamic text boxes. The
text in these dynamic boxes is scripted to link to web addresses
contained in the RSS feeds in the same node as the text being
displayed. So far so good. Now I need the text in these boxes to
act as if they were HTML links and show an underline and color
change when rolled over and clicked on. Help. Attached is my code.The trick with the help files is to realize that everything
is organized by classes. So if you want to do something with
text...
Open the help files and select the ActionScript 3.0 drop
down. Then from that list Expand the Actionscript 3.0 language
reference and the All Classes section. Next scroll down to the "T"
section and start looking.
The ones that seem interesting to me for what you were
looking for are TextField and TextFormat. Even if you don't know
exactly what you need those seem like they would have something to
do with text and how it looks.
Then start looking through the entries for each of those
sections. Everything that can be done with text is in there. So
after looking at TextField I didn't see anything about making an
underline or even how to change the color. But I did see a method
called setTextFormat()
So next I check out the documentation on the TextFormat class
and sure enough there is an underline property.
Great, so by this point I've figured out how to make some
TextFormats and then use the setTextFormat() method to apply them.
So next you've got to figure out how to apply the different formats
when I want them.
Things that happen at certain times are events, so anything
that you want to happen now, not then -- or I suppose then, not
now! -- will require an event. So again it is something about
events. So I'll go back to the textfield class and see what kind of
events there are. At first glance you might think that TextFields
only have 4 events -- change, link, scroll, textInput -- and that
none of them seem to be what you would want. Now this is the tricky
part...
At the top of the events section in the documentation there
is a little arrow for "Show inherited events." So going down that
list you will find that TextFields get a lot of events from
inheritance. Sure enough reading down the list I see mouseOver and
(this is important) finishing the list I also see a rollOver. They
both seem promising. Always read the entire list. There are many
times when there are two similar things and if you stop at the
first you might miss out.
Anyways, I hope that this helps you see how the process can
work. The Flash help files are actually pretty awesome and helpful,
but you have to know how to work them. You will very seldom find
the answer by searching or find a fully formed answer to your
specific needs.
Break it down into the classes you think you might need. Then
look for the properties, methods, and events you might need. Most
of them have fairly straight forward names the should suggest what
they might be for. And then follow the hyper links to related
classes than their methods, properties, and events.
PS: I just noticed your second problem. So do the same thing.
So notice that if you look through the TextField class there isn't
anything that lets you chop a string or cut it up or anything. But
notice the text property of the TextField class. That is what shows
in a textfield. And notice that it takes a String.
If you didn't know it a String is some text. You would never
find the String class if you didn't know that techy word, but by
noticing how often it is mentioned in the TextField class you could
get there.
So next look at the String class. What methods and properties
do you need for what you want to do?
The length property might tell you when a String is too long.
And the methods substr() and substring() seem promising to
cut up part of a String.
Finally adding an ellipsis at the end might be hard to figure
out if you don't know the trick. Fortunately you only need to read
the methods to the "c" or concat(). Fancy talk for putting strings
together. Always read the entry to the end. There you will see a
link for "See Also Concatenating Strings." That will show you that
you can easily use a plus sign to add strings together -- just like
addition. -
Iterate through all dynamic text variables
Hello,
I'd like to be able to iterate through all of the dynamic
text variables in my flash movie, and I'd like it so that if I add
new text to this movie, it will show up in the iteration.
Essentially, I want to do something like this:
for (i in _root) {
trace(i);
While this seems to print out all the variables in root, it
prints more than just the dynamic text variables, and also doesn't
iterate down through various objects to find the dynamic text
variable.
Is there any way I can accomplish this in action script?
Thanks!Great! That code helps me a lot.
There are still two weird issues.
1) the test for tl[obj].text seems to always turn out to be
false. However, if I trace the value of text, I'll see the text.
Example:
trace(tl[obj].text); // This will display the value in the
text field
if (tl[obj].text) // This is always returning false.
Any ideas?
The 2nd issue might be more difficult - some of my text
objects don't appear until later in the movie (i.e. frame 10). It
sort of looks like this looping doesn't see objects that appear in
the future. Do I need to advance the frame 1 by 1 and repeat this
looping process until the text appears? Maybe instead I can always
have the text in the first frame, but have it be invisible or
something?
Maybe you are looking for
-
Error on Intel no error on PPC
I am developing a cocoa core data document program on both a MacBook (intel) and a mac mini (ppc). On the PPC, the project compiles and runs fine, but on the Intel, it compiles fine, but at runtime I get the following error. 2007-05-07 14:54:19.942 m
-
New OS Downloaded but Not Installed
I downloaded the new OS 4.2, but it did not install. How doI get it to install.
-
BadStatusException??
Occasionally, we see this message in the standard out of our weblogic server. Can somebody tell us what causes it and what it means? does this message imply that our clustering and failover are not working at that time?
-
Changing the state of Iterator?
Hi! I'm using ADF Faces, and I want to change the state of an Iterator from a backing_bean? Is it possible? If it isn't: anybody knows how to manipulate manually the state of an iterator? Thanks in advance, Jaime.
-
Need recommendation for external DVD burner drive!
I'm one of the officers for a film club at the University of North Carolina at Wilmington. Recently, I discovered that we had, in our offices, a fully-functional, if not somewhat dated, iMac G4. After getting the neccessary OS X upgrades (it's now ru