Externally Loaded Dynamic Text Problem
Hi,
Has anyone encountered problems loading in a % sign as part
of a string? For example I'm loading the following in from a
database through an asp page using sendAndLoad (this is just a
snippet of the results):
&AnswerEN1_1=8% &AnswerFR1_1=
The variable AnswerEN1_1 drops the % sign. The value for the
variable is just 8. if there's no space between the next variable
the value of AnswerEN1_1 becomes 8AnswerFR1_1= removing the &
as well
Any ideas, solutions?
Thanks,
Sean
Flash is seeing % as the start of a URL code--or perhaps ASP
is when it serves it up. Either way, you should be able to avoid it
by pruposely URL encoding it. I don't know any ASP but I'm sure
there is a URL encode function somewhere. Otherewise, the code for
% is apparently, %25, according to here:
http://meyerweb.com/eric/tools/dencoder/
Similar Messages
-
Load dynamic text into Captivate form external file
Is it possible to load dynamic text into a Captivate file from an external file like an XML using Javascript.
I see there's a way to get it form the query scring of the URL ( http://captivatedev.com/2011/05/01/how-to-jump-to-a-specific-slide-in-a-separate-course/ ), but I have a project where I want several pieces of text to be replaced and we want to be able to edit it externally from the Captivate file.
Thanks!Hi Ned,
What I'm doing is using a yahoo map to load addresses and
place custom swf files as the placemarkers. The main stage has an
instance of myMap, which is the map that yahoo sets us to display
the ACTUAL map. They have also provided coding for placing markers
on the map, which is what I'm using.
I have the addresses throughout multiple xml files, which I
am actually loading through 1 single xml file. These addresses are
being stored in an array, then called by the AS below to place
markers. All the markers are placed correctly, however, I am trying
to have them actually say the address - this is where the problem
lies.
The marker that is being located and placed has a text field
called load_text in it. I want that field to load the same address
that is being used to place it (from the array addressA).
I'm very confused because every loop through the * for (i=0;
i<addressA.length; i++) * loop the marker is placed at the
correct addressA
location, but I cannot actually get the address to load into the
load_txt field in the marker. I can even run a trace during that
loop and it traces addressA for each address, but I can't seem
to actually load those values into the load_txt box.
Do you have any ideas? -
ScrollPane + Dynamic text problem.
Hi,
I use the ScrollPane component to display a movieclip which contains some text. Until now I have entered just a few paragraphs, with the text field set to "Static text"...but as I have wrote some more I noticed that the text field displays only half of my text. So I have switched to "Dynamic text", which solves the display issue and I get 100% of my text but now I have it always on the scene displayed, even if it is only available in the library...strange!
Could somone help me out please??
Regards,
vedtamOk, I try to make my self clear.
I have to display a really long text on this website. By default when I am typing anything the Text tool is set to "Static text" in that little drop down in the Text Properties window. So I have moved on whit this, but after more then 50-60 paragraph typed in I get only 30 displayed. Than I went to that little drop down and selected "Dynamic text" to see if this helps, and when I have tested the movie again the text was displayed with all its 60 paragraph, but it was overlapping all my other content without pressing its button (without calling it).
The movieclip which contains the text, sits in the library, and the ScrollPane component (which loads it externally) is in the scene on the 1st frame. Again, as I test the movie I get the text showing up in the background, so as I click any menu item it is overlapping any other content.
What I would like to achieve is to have the text displayed without an issue (not only a half of it). But this task is failed by the "Static text" option and setting it to "dynamic text" solves the first problem while rises a second (the sudden appearance of the text on the scene without calling it).
I hope this second explanation helps,
Vedtam -
How to load dynamic text inside a movie clip?
hello all - i have a main stage where on the first frame my
"home" movie clip displays. i did this by dragging/dropping, and
then i put a stop action. all works fine.
inside this home movie clip on the main stage, there are
links to other movie clips. for example, to get to my faq's page -
you click that button, then it takes you to frame 4 on my main
stage, where my faq's movie clip (followed by stop action) has been
dragged/dropped and displays properly.
within the faq's movie clip this process is repeated, with
buttons taking to you various pages (different frames where
different movie clips play - all works fine).
so now i want to add a dynamic text field within my faq's
movie clip. i have read numerous tutorials where i have created the
text file but i have not been able to display it with success
within my faqs movie clip.
here is some code that my dvd tutorial instructs me to place
on main stage as i practice getting this to work:
var myMCL:MovieClipLoader = new MovieClipLoader ();
var myListener:Object = new Object();
myMCL.addListener(myListener);
var myLV:LoadVars = new LoadVars();
myLV.onLoad = function (success:Boolean) {
if (success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been an error loading
the requested information. Please contact the webmaster.";
and here is some code that i place on the faqs button within
my main movie clip that takes me back to main stage and plays faq
movie clip all successfully:
on (release) {
//Movieclip GotoAndPlay Behavior
_root.gotoAndPlay("4");
//End Behavior
and finally, here is some code that i place within my faqs
movie clip in an attempt to display my dynamic text within the faqs
movie clip - so far unsuccessful:
_level0.myLV.load("vars/faqs.txt");
NOTE:
i have published this to view - not working.
i have my faqs text file starting as info=
i have eliminated white space within my text file
i am using flash 8 pro
can anyone offer some sugestions? thanks!hmmmmm lemme double check as i seem to be a bit lost now.
// this is my actions layer code on frame 4 of main timeline:
stop();
var myLV:LoadVars = new LoadVars();
myLV.onLoad = function (success:Boolean) {
if (success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been an error loading
the requested information. Please contact the webmaster.";
myLV.load("vars/faqs.txt");
1. fyi - at frame 4 on main timeline, one layer beneath the
actions layer where i dragged/dropped my faqs movie clip i gave my
faqs movie clip an instance name of "mainfaqs" - although nowhere
do i refer to this specific mc within my code.
2. where would i replace/insert the following code?
_level0.faq_mc.loadedInfo.text = myLV.info;
3. i didn't know about embedding font but i saw the option
and embedded it - still no results.
4. i'm not sure how to do the following:
_level5.loadedInfo.text ='test'; //although I would still
change the path as above
To see if your getting a return from the load call adn text
file, use a trace statment before the success condition and see
what it returns:
trace(myLV);
sorry to be such a pain - i really have looked around for
answers through previous postings and i googled it and i've been
taking instruction through lynda.com and dvds but i seem to be
stuck here.... as always - thanks for your time -
Dynamic text problem in flash cs5
Hi guys,
im building a flash website and the first page has dynamic text fields that load text via xml, that all works fine. But when i create a dynamic text field further up the time line for the second page ( i use the same code all at the fist frame of the timeline) and nothing loads. if i have an instance of the text on the first page at the start of the time line it will load on the next page (further up the time line). Ii have stop and click to go and play in the code to break up the pages.
I am a little lost, as i normally use static text.
any help would be greatly appreciated.
cheersAh found out myself the hard way that i need to put the text feild inside its own symbol!
only took me all morning -
Hi,
I have some dynamic text within a scrolbar controlled box. I
need to link certain words of the text but, whenever I attempt to
do this, the entire text block becomes 'linked'. Does anyone know
how I can solve this?
Many thanks.Then you'll need to use html links for the words. So when you
assign the text to the textfield, you'll need to assign it as...
tField.htmlText = "text.... <a href='...>link
text</a>"... text;
where tField is whatever instance name you assigned to the
textfield -
Iv not used flash for a while so am just converting from AS2
to AS3 and am having problems with some simple actionscript
I have a dynamic textbox created through actionscript inside
a movieclip and im trying to change the content of this but save
the previous value.
Iv taken the previous value and saved it in a variable (a
string) called
oldTxt (witch is working when i use trace statements to
check)
and then assigning the new text with
theTextField.text = "some new text"; (again working
perfectly)
the problem is when i try to re-asign the old value stored in
oldTxt, nothing happens.
the code im using is
theTextField.text = oldTxt; but its just removing all the
text.
any suggestions?button.addEventListener(MouseEvent.ROLL_OUT, navOut);
function navOut(MouseEvent):void {
trace(oldTxt);
theTextField.text = oldTxt;
works fine when i replace oldTxt with "some new text" and the
value of oldTxt is coming up in the trace -
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. -
Hi
I have figured out how to load dynamic text from an external
text file.
I need to do the same with an ASP file that pulls its data
from a database.
How is this done with Flash CS4? I can't find any tutorials
anywhere and Adobe's documentation is non-existent.
Can you tell me how? Or show me where there is a (useful)
tutorial?
Thanks!>> The dynamic text instance name is "loadText"
Then you need to use the text property of the instance:
this.loadText.text = Math.round(getPercent*100)+"%";
Dave -
Adobe Community Expert
www.blurredistinction.com
http://www.adobe.com/communities/experts/ -
Can anyone help with this? I'm trying to get text on a screen
to link to documents (that will be on a CD, currently on my hard
drive) such as pdf, txt etc. Using Flash 9.
Thanks.Thanks again for your reply. Since my last posting, I have
gotten mostly everything figured out except the main issue, which
is creating a link to documents from text. In the following code I
was able to load dynamic text from an external txt file and I
inserted an html link in the txt file but I don't want to open a
browser link, but rather a file on CD or hard drive:
var textLoader:URLLoader = new URLLoader();
var textReq:URLRequest = new URLRequest("test.txt");
function textLoaded(event:Event):void
getStart_txt.htmlText = textLoader.data;
textLoader.load(textReq);
textLoader.addEventListener(Event.COMPLETE, textLoaded);
So everything looks good, except how do I get the html link
in the text file to open a doc instead of a url? Or maybe something
in your post will work.
Regarding buttons and code, this is from a Flash website:
"So you just started AS3.0 full of excitement and ready for
some coding challenges, you start coding your first button and
suddenly, horror, you end up with "WARNING: Actions on button or
MovieClip instances are not supported in ActionScript 3.0. All
scripts on object instances will be ignored." or "1119: Access of
possibly undefined property onPress through a reference with static
type flash.display:SimpleButton.", indeed the good old AS2.0 event
system is not working anymore in AS3.0: onClipEvent, onPress,
onRelease, onLoad, onMouseDown ..etc, have become things of the
past!!!
What happened? well basically the whole event handling system
has been revamped in Actionscript 3.0 and we are going to have a
quick look at it."
When I select a button in Flash 9, the error message I get is
"Current selection cannot have actions applied to it."
Thanks. -
Flash 7 dynamic text box IE issues
Hi all,
I am having issues with IE V.6.0.3790.0 not loading dynamic
text into text boxes inside a Flash 7 SWF on a remote desktop. Does
anyone know of any compatability issues with dynamic text boxes and
IE? The file loads properly into Safari on my MAC, and I have the
latest Flash Plugin installed. Could it be a Plugin issue, rather
than a IE issue? The reason I am asking is I have a site launched
and many people cannot see the pages that pull in Dynamic text. I
am trying to either get to the bottom of it and provide a fix, or
at least come up with some answers!quote:
Originally posted by:
AnandMX
use embedFonts=true
coz it seems that your fonts are not embedded thats y it is
not visible there.
Thanks - but why would the fonts be visible in Safari and
Firefox, for example, and not in that version of IE? -
Dynamic text printing - is it possible?
ok,
I have wasted most the day trying to find an answer to this,
so if anyone knows if this isn't possible, please let me know.
I have SWF that is loading dynamic text, which I am trying to
PRINT. So basically, just a button that you hit that sends the text
to a printer, nothing more nothing less, sounds simple bloody
isn't!
ThanksThe answer is
yes it is possible!
But I thing you knew that, I'm not an expert on the Print
class, and as you don't tell us what happens right now when you
press the button I can only take guesse at some things.
If you print a clip (what is what you'r trying) flash prints
more or less what ia on stage, so if due to scroll text is hidden
on stage you would'n get it on paper this way.
The solution is to make a new clip that shows all text
(need'nt be vivisble can be off stage for example) and print that.
Fitting it to a certain size is another matter but as you
allready have expirience with that (looks like at least) I won't
dwell on that.
Fitting to a print page you will have to work with the
PrintJobClass as Christopher suggested. The documetation is quite
goo since Flash 2004. -
Dynamic Text in Externally Loaded swf
hi. i have a dynamic text field in an externally loaded swf. Its a digital clock so i want the numbers to update in the dynamic text field.
this is not my exact code but it is very similar. i show below that i add the loader.swf, and once its loading is complete, i can work on its movieclips and add event listeners to its buttons, etc. but i cannot change the dynamic text field (its "classic text" set to "dynamic text"). after running this, the text just stays empty as it is in the external swf).
here is the sample code:
var loader:Loader = new Loader();
loader.load(new URLRequest("loader.swf"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
function loaded(event:Event):void{
addChild(loader);
var loader_mc:MovieClip = (loader.content as MovieClip)
loader_mc.myMovieClip.gotoAndStop(2);//***this works
loader_mc.myButton_btn.addEventListener(MouseEvent.CLICK, clickMe);//***this works
loader_mc.myText_txt.text = "12";//***this doesn't work******
please help. thanks!Did you embed the font in the textfield--it needs to be done in the loaded swf when you create it? One other thing to check is that the color for the textfield is not the same as the background it sits on.
-
Is Dynamic Loading of Text from an external file possible in Captivate?
Hello all,
I am wondering if Dynamic loading of text is possible in captivate or not.
As we can load an external file in flash.
& which is the universal font to be used for the text entry box which will visible on any media?
Thanks & Regards,
ChiragHello,
I'm not a specialist about JavaScript. Have a look at Jim Leichliter's blog:
http://captivatedev.com/
Lilybiri -
Linking a class to a dynamic text field to load XML data.
Hi,
I'm quite new to ActionScript and would be grateful for any help here.
I want to load text into a dynamic text field (called 'about_tab') using a class depending on the language selected (by clicking on a flag icon) by the user.
I managed to get this to work when the ActionScript was written directly in the timeline, but am having problems with doing the same thing via a class.
This is my class file:
package
import flash.display.SimpleButton;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.Event;
public class ChangeLang extends SimpleButton
public function ChangeLang()
addEventListener(MouseEvent.CLICK, switchLang);
trace("ChangeLang class working");
public function switchLang(event:MouseEvent):void
var lang = event.target.name;
var req:URLRequest = new URLRequest("languages/"+lang+".xml");
var loader:URLLoader = new URLLoader();
var substance:XML;
function xmlLoaded(event:Event):void
trace("function xmlLoaded is running");
substance = new XML(loader.data);
about_tab.text = substance.about_lbl;
loader.addEventListener(Event.COMPLETE, xmlLoaded);
loader.load(req);
Here's one of my XML files (the other is the same except "About" is written in German):
<substance>
<about_lbl>About</about_lbl>
</substance>
When I run it, it returns my trace statements that the class ChangeLang and the function xmlLoaded are running, but no text appears in the dynamic text field (I should/want to see the word 'About'). I get this error message:
1120: Access of undefined property about_tab
The problem, I'm guessing, is in the part in red in my code. I think I need to target the text field in the display list by creating a reference to it. If so, could someonw point out how I do this, or perhaps a tutorial that would help. I've tried adding the word stage (i.e.,stage.about_tab.text = substance.about_lbl; ) but it still doesn't connect. I guess there's something really simple I'm missing, so I apologize if this comes across as a stupid question
Thanks for any help.Hello flashrocket!
I'm also new to AS3 and I've just started using external classes and I think I know what you should do to put your code to work.
Instead of using the text field you created inside your flash file, why don't you use the "TextField" class to create an instance of this object? It's the exact same thing as when you create and instantiate a new text field inside Flash.
First, import flash.text.*; (includes classes like TextField, TextFieldAutoSize, TextFormat, TextFormatAlign, etc)
Than you just have to create a var like
public var about_tab : TextField;
or
public var about_tab : TextField = new TextField();
then, to adjust the properties of this tab you use dotsyntax as if it where on your stage like:
about_tab.x = 50; about_tab.alpha = .5; etc...
you can even create a function to "config your textField"
private function createAndConfigTextField() : void {
about_tab = new TextField(); //you only need this line if you
// only typed something like "public var about_tab:TextField;
// if instead you used "public var about_tab:TextField = new TextField(); outside
// this function, just skip this first line because you already have an instance of
// text field named "about_tab"...
about_tab.autoSize = TextFieldAutoSize.CENTER;
about_tab.background = true;
about_tab.border = true;
var aboutTextFormat : TextFormat = new TextFormat();
format.font = "Arial";
format.color = 0x000000;
format.size = 11;
format.bold = true;
format.align = TextFormatAlign.CENTER;
about_tab.defaultTextFormat = aboutTextFormat;
addChild(about_tab);
This is just an example of what you can do... I hope you get it... let me know if you have any doubt...
Maybe you are looking for
-
How do I set my printer to print on odd sized paper? HP Officejet Pro 8000
I need to print on a 8.5 x 4.5 sheet on pre-cut paper, is this possible?
-
Locating correct drivers for kernel [solved]
So I was practicing kernel building today and decided to become more adventurous I am going through each line and removing anything that is not specific to my computer, but I am running into an issue. Here is an example. Hardware monitoring support.
-
3502I access point unsuccessful software upgrade
Hi all. I have a trouble with AIR-CAP3502I-R-K9 AP and I want to ask help. I tried to upgrade IOS software in ap because it was connecting and disconnecting to controller too often. I already upgraded one of two access point and it working stable a
-
Deploy EJB : Errors compiling the communication stubs
Compiling Stubs...Errors compiling the communication stubs /tmp/ejb/oraclex/java/awt/ColorPackage/ColorSpaceHolder.java:35: Class java.awt.ColorPackage.ColorSpace not found. public java.awt.ColorPackage.ColorSpace value; ^ /tmp/ejb/oraclex/java/awt/C
-
Are iWeb pages exportable to other hosts?
if iMac should become NOT my webhost of choice would it be possible to export my iWeb pages (and website)?