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




The Infamous Ampersand (loadVariables)



This is a friend's question, he's searching for a very fast answer, I would definitely would not use loadVariables this way. Anyhow, he used an external txt to hold html-formatted stuff, now he has to insert a php 'link', for example:

<A HREF="http://www.lecool.com/entrevista.php?newsletterID=68&idioma=ESP" TARGET="_new"><b></b>, 10-11-02<br><br>Sobre Sobre Paul Orsen</A>

the problem being the presence of the '&' necessary for the php link but that Flash treats as a new variable hahaha

well, any clues? it would be easy to implement an external '.as' file with the variable and #include the file...



Ultrashock Forums > Flash > ActionScript
Posted on: 2003-11-16


View Complete Forum Thread with Replies

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

Ampersand In LoadVariables
You know how & is used to seperate variables in a .txt file if your loading variables, like &height=22&width=3353&....well what if you want to pass a string into flash like "We all went & drunk lots of beer"? Can you do it?

This Infamous Loadmovie Questions
I felt the need to contribute my share of loadmovie questions, specifically just two that I can't figure out even after searching the boards. I can load the movies fine but I'm having two problems. 1) Once the .swf loads within my main movie, I can't click on any of the .swf's buttons to go through the loaded .swf. Whats the problem here? 2) I want to size all the movies to a certain size so that they fit into a designate area, whats the code in MX to restrain movies to specific sizes. Heres my code...

on (release) {
_root.empty.loadMovie("atm.swf")
}


Thanks
RastaRoss

The Infamous Pixel Shift..
I know this has been discussed on this forum probably more times than it should have been.. however it's got me in a state of confusion.

http://www.1337designs.com/test/main/loadmovie.htm

the bottom section there are three content windows, the two side windows are fine, however the larger window on the left, the top bar is experiencing pixel shift. (on the left side where the angle is)

I have allow smoothing off, I have tried breaking it apart, it was imported as a PNG, it's dimensions are exact (375x14) and it sits on a complete axis (-337,-117).. I have also tried scaling it to 99%. Nothing seems to work.. any ideas?

Thanks in advance.

The Infamous Error #1009. Can Someone Help.
I'm trying to load a swf slideshow into a fla file by using this code


Code:
var request:URLRequest = new URLRequest("XMLSlideshow.swf");
var loader:Loader = new Loader();



loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);

function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
percentLoaded = Math.round(percentLoaded * 100);
trace("Loading: "+percentLoaded+"%");
}
function loadComplete(event:Event):void {
trace("Complete");
var swf:MovieClip = event.target.content as MovieClip;
swf.x = stage.stageWidth/2;
addChild(swf);
}
loader.load(request);
Through searching I figured out that my swf might not be on stage and that I need to add my swf to the stage by using the ADDED_TO_STAGE event. But where do I put it in my slideshow as code?


Code:
package {
// imports
import flash.display.Sprite;
import flash.events.Event;
import flash.events.ErrorEvent;
import flash.events.ProgressEvent;
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.xml.XMLDocument;
import flash.events.TimerEvent;
import flash.utils.Timer;

public class XMLSlideshow extends Sprite {

private var xmlFileLoc:String;//location of xml file
private var slideTimer:Timer;
private var urlLoader:URLLoader;
private var data:XML;
private var _slide:String;
private var i:uint;
private var cNodes:Array;
private var child1:Loader = new Loader();// declared here so it can be accessed in all functions
private var child2:Loader = new Loader();// declared here so it can be accessed in all functions
private var contLoaded:uint;
private var _control:Control = new Control();
private var isPlaying:Boolean;
private var childVal:uint;
private var _preBg:PreBg = new PreBg();//preloader bar

//constructor
public function XMLSlideshow(xmlFileName:String, ctrl:Boolean, timerVal:uint) {
{
addEventListener(Event.ADDED_TO_STAGE,XMLSlideshow);
}

slideTimer = new Timer(timerVal, 0);

child1.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
child1.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
child1.contentLoaderInfo.addEventListener(Event.COMPLETE,showLoadResult);
child2.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
child2.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
child2.contentLoaderInfo.addEventListener(Event.COMPLETE,showLoadResult);

var urlRequest:URLRequest = new URLRequest(xmlFileName);
urlLoader = new URLLoader();
urlLoader.addEventListener("complete", onLoaded);
urlLoader.addEventListener("ioerror", ifFailed);

urlLoader.load(urlRequest);

slideTimer.addEventListener(TimerEvent.TIMER, onTick);
slideTimer.start();
isPlaying = true;

child1.x = child1.y = child2.x = child2.y = 0;
addChild(child1);
addChild(child2);

if (ctrl == true) {
_control.txtDesc.text = "";
addChild(_control);
setChildIndex(_control, this.numChildren - 1);
_control.x = 400;
_control.y = 15;
_control.mcCtrlBg.alpha = _control.btnPause.alpha = 0.4;
_control.btnForward.alpha = _control.btnBack.alpha = 0;

_control.btnPause.addEventListener(MouseEvent.MOUSE_OVER, ctrlOver);
_control.btnPause.addEventListener(MouseEvent.MOUSE_OUT, ctrlOut);
_control.btnPause.addEventListener(MouseEvent.CLICK, ctrlStop);
childVal = 3;
} else {
childVal = 2;
}
}
// control stuff
private function ctrlOver(evt:Event):void {
evt.target.alpha = 1;
if (evt.target.name == "btnPause") {
if (isPlaying == true) {
_control.txtDesc.text = "Pause";
} else {
_control.txtDesc.text = "Play";
}
} else if (evt.target.name == "btnForward") {
_control.txtDesc.text = "Next";
} else if (evt.target.name == "btnBack") {
_control.txtDesc.text = "Back";
}
}
private function ctrlOut(evt:Event):void {
evt.target.alpha = 0.4;
_control.txtDesc.text = "";
}
//stop button
private function ctrlStop(evt:Event):void {
if (isPlaying == true) {
slideTimer.stop();
isPlaying = false;
_control.btnForward.alpha = _control.btnBack.alpha = 0.4;
_control.btnBack.addEventListener(MouseEvent.MOUSE_OVER, ctrlOver);
_control.btnForward.addEventListener(MouseEvent.MOUSE_OVER, ctrlOver);
_control.btnBack.addEventListener(MouseEvent.MOUSE_OUT, ctrlOut);
_control.btnForward.addEventListener(MouseEvent.MOUSE_OUT, ctrlOut);
_control.btnBack.addEventListener(MouseEvent.CLICK, ctrlBack);
_control.btnForward.addEventListener(MouseEvent.CLICK, ctrlForward);
_control.txtDesc.text = "Play";
} else {
slideTimer.start();
isPlaying = true;
_control.btnForward.alpha = _control.btnBack.alpha = 0;
_control.btnBack.removeEventListener(MouseEvent.MOUSE_OVER, ctrlOver);
_control.btnForward.removeEventListener(MouseEvent.MOUSE_OVER, ctrlOver);
_control.btnBack.removeEventListener(MouseEvent.MOUSE_OUT, ctrlOut);
_control.btnForward.removeEventListener(MouseEvent.MOUSE_OUT, ctrlOut);
_control.btnBack.removeEventListener(MouseEvent.CLICK, ctrlBack);
_control.btnForward.removeEventListener(MouseEvent.CLICK, ctrlForward);
_control.txtDesc.text = "Pause";
}
}
//forward button
private function ctrlForward(evt:Event):void {

if (contLoaded == 1) {
setChildIndex(child2, this.numChildren - 2);
if (i == cNodes.length - 1) {
i = 0;
} else {
i += 1;
}
} else if (contLoaded == 2) {
setChildIndex(child1, this.numChildren - 2);
if (i == cNodes.length - 1) {
i = 0;
} else {
i += 1;
}
}
_slide = data.slide[i].url;
loadImage(_slide);
}
//back button
private function ctrlBack(evt:Event):void {

if (contLoaded == 1) {
setChildIndex(child2, this.numChildren - 2);
if (i == 0) {
i = cNodes.length - 1;
} else {
i -= 1;
}
} else if (contLoaded == 2) {
setChildIndex(child1, this.numChildren - 2);
if (i == 0) {
i = cNodes.length - 1;
} else {
i -= 1;
}
}
_slide = data.slide[i].url;
loadImage(_slide);
}

//xml stuff
private function onLoaded(event:Event):void {
data = XML(urlLoader.data);
parseData(data);
contLoaded = 1;
i = 0;
_slide = data.slide[i].url;
loadImage(_slide);
}

private function ifFailed(errorEvent:ErrorEvent):void {
trace("ERROR");
}

private function parseData(data:XML):void {
var x2:XMLDocument = new XMLDocument();
x2.ignoreWhite = true;
var list:String = data.toXMLString();
x2.parseXML(list);
cNodes = x2.firstChild.childNodes;
}

// timer function: runs every interval
function onTick(event:TimerEvent):void {

if (i == cNodes.length - 1) {// if in the last slide, go back to first slide
i = 0;
} else {// if not in last slide, increment by one node
i++;
}
// load the image.
_slide = data.slide[i].url;
loadImage(_slide);
}

// image loading
private function loadImage(url:String):void {
var request:URLRequest = new URLRequest(url);
if (contLoaded == 1) {
child2.load(request);

} else {
child1.load(request);

}
}
private function showPreloader(evt:Event):void {
addChild(_preBg);
_preBg.x = 400;
_preBg.y = 32;
_preBg.width = 90;
_preBg.height = 5;
_preBg.alpha = 0.5;
}

private function showProgress(evt:ProgressEvent):void {
_preBg.gotoAndStop(Math.floor(evt.bytesLoaded/evt.bytesTotal*100));
}

private function showLoadResult(evt:Event):void {
if (contLoaded == 1) {
addChild(child2);
child2.alpha = 0;
setChildIndex(child2, this.numChildren - childVal);
TweenLite.to(child2, 0.8, {alpha:1});
contLoaded = 2;
} else {
addChild(child1);
child1.alpha = 0;
setChildIndex(child1, this.numChildren - childVal);
TweenLite.to(child1, 0.8, {alpha:1});
contLoaded = 1;
}
_preBg.alpha = 0;
}
}
}

The Infamous ComboBox (and ASPMail)
OK. I've now read about 50 ComboBox Posts and I now know nothing about them - I'm actually even more confused, if that's possible. I really need to learn how to use them to pass some data, though. Here's what I got ... I have a simple Flash Form with 8 text input fields and 2 comboboxes. I have an ASP Processing Script that gets the variables from Flash - processes them and shoots out an e-mail. ((Works great with just the text input fields))

All I really need is a way to get the ComboBox's user selection and pass that information as a variable to my ASP Script. It sounds so simple. But, I can't seem to find the "do this - do that" answer. So, please help.

From one post I read ... I tried to set up a dynamic text field and load it with the selection from the ComboBox like...
Dynamic Text Field Instance Name = InstSize
Dynamic Text Field Variable Name = VarSize
ComboBox Instance Name = ComboSize

InstSize.VarSize = ComboSize.selectedItem.label;

But, I can't figure out where to put that code (does it go on a keyframe, on an event or something else)?

And then do I need to put anything on the submit button to capture this — other than the loadVariablesNum ("FlashProcessing.asp", "0", "Post"); or will that just grab all the variables in the form and shoot them to the ASP?

Again, anyone that can help me with this item - would be great. TY!

The Infamous Accelescroller. Or, Why I'm Losing All My Hair.
I've tried to disassemble the accelescroller, now that the tutorial is no longer online. I've also found a similar tutorial here on Flashkit but it's ridiculously ambiguous, and is only one page long.

I'm completely confused. Does anyone know where a SIMPLE, user-friendly tutorial for an accelescroller-like movie is at? All the ones I've found are COMPLETELY different from one another but they all have one thing in common.

They're all confusing the hell out of me.

I have my scrolling graphic. I just need a tutorial to push me in the right direction.

Thanks.

The Infamous 'Loader()' And Event Handling
Hello everyone.
First post. I've researched this topic pretty detailed for 2 days now. I've come up with the conclusion that this is the best way to go.

Loader(), we use it get external images/swfs. To access its properties (after it's been loaded), we use event listeners. These event listeners call a function that perform tasks on our newly loaded content, but what happens if these instructions need to be dynamic, this means passing your own extra parameters / arguments / variables from the scope of where you add the listener to the actual listener function.

Code is posted below... Essentially I had an addGraphic Method that would add a graphic at a certain x, y coordinate and at a certain width/height. I tried to set a temporary variable in the class but the listeners were too slow, and if i had an addGraphic call, all the objects in the listener function would use the LAST addGraphic's calls details.

I thought that using a Custom Event would be best. Very clean and orderly, and maybe this is where I could use some help, how do you override the Loader() 's dispatch of the Event.INIT to instead dispatch your custom event that allows for parameters so that it would be event.var1 event.var2 (where var1 and var2 are get methods setup in your custom event)?! OR maybe another way so your listener could be loaderObj.addEventListener(CustomEvent.INIT, listenerFunc, param1, param2) ?? Either solution (custom event or custom listener) would be great. I like to follow standard code and keep things clean.

Anyways if anybody could answer that, that would be great, for those of you that need a solution, this is what I've come up with. It's basically a version of the "Anonymous function" but by assigning it a value before hand you can basically remove the Listener (which is a big deal in some situations).

Thanks for any help, and maybe my solution can be some guidance to those that struggle with this.


Code:

public function addGraphic(graphicString:String, graphicPath:String, x_pos:int, y_pos:int, useWidth:int, useHeight:int){

var picHolderMC = new MovieClip();
stageRef.addChild(picHolderMC);

var loadGraphic = new Loader();
loadGraphic.load(new URLRequest(graphicPath));

var picLoadSetup = new Array();
picLoadSetup["xPos"] = x_pos;
picLoadSetup["yPos"] = y_pos;
picLoadSetup["picWidth"] = useWidth;
picLoadSetup["picHeight"] = useHeight;
picLoadSetup["useMC"] = picHolderMC;

/*
hack: Intermediate EventListener to pass the event and extra parameters.
although everything could be handled here, it is cleaner to see the
instructions for what is to happen when the graphic is finished being loaded.
*/

var graphicEventPasser = function(e:Event){
graphicLoaded(e, picLoadSetup);
}

loadGraphic.contentLoaderInfo.addEventListener(Event.INIT, graphicEventPasser, false);

}

public function graphicLoaded(e:Event, picLoadSetup){

var x_pos = picLoadSetup["xPos"];
var y_pos = picLoadSetup["yPos"];
var useWidth = picLoadSetup["picWidth"];
var useHeight = picLoadSetup["picHeight"];
var useMC = picLoadSetup["useMC"];

var loadedPicture = e.target.content;
useMC.addChild(loadedPicture);

loadedPicture.x = x_pos;
loadedPicture.y = y_pos;
loadedPicture.width = useWidth;
loadedPicture.height = useHeight;

}

The Infamous Pageflip : Adding A Page Parker System
Hi everyone
Please check this link :
http://www.castorama.fr/satellites/2...equestid=66326
Once it's open, clik on one of the books or on "consulter le catalogue en ligne"...
Once this is done you should be on an interactive catalogue that uses pageflip...This my question :
See the post-it block in the middle of the pages on top? It's used for marking pages...HOW DID THEY DO THAT???!!!???
I can't even start to figure out what technique i should use...
Does anyone have the slighest idea?

Ampersand From Php
Is there anyway to get an ampersand to display as a '&' when loaded into a dynamic text field. When bringing in content from an outside source the '&' symbol indicates a division cuts off the string.

I would like to escape it somehow but cannot figure it out.

Thanks.

Ampersand &
Hey,
I have a problem when adding the & into the url.
i need to figure out a way on how to paste an & from actionscript into a URL.
Without using %26 or & , because & breaks the url link in actionscript / javascript.
is there a way that i can add or declare the & as a variable or string or something?!

for example:
else if (y==3) {
var = &;
link=_root.clickTAG + & +"gradyear=" + container.optionlist.year2;
getURL(link,"_blank");
}
that dosent work but im hoping somebody gets the ideo of what i am trying to do:
i want the url to look like this for example
http://www.school.edu/?brf=&gradyear=1997

I tried it with the %26 but i dont get the desired effect.

Please help,
im pulling my hair out at this point,

best,
V

Ampersand
Hey all,

I can't find the answer in the forums maybe someone could point me to it.

I have a .txt file with hyperlinks. What I want to do is incorporate the & and the % signs. As we all know the & breaks for a new variable. I have tried encoding but to no avail any ideas.

an example of what I am attempting is to have linka to Map Quest. When a person clicks on the link in question a separate page opens with the location already typed into the fields and a map displayed.

Any help much appreciated.

Ampersand
I have a dynamic text field, and I'm setting the value of this field using AS. The string I'm assigning to this field has an ampersand in it, but it doesn't display, just appears as a double space. If you have a dynamic text field, and try and set the text to read "M&Ms" using "M%26Ms", it ends-up displaying M26Ms. Flash appears to ignore the % character, but not replace the code with an ampersand.

Any ideas anyone?

Ampersand
Hi,

I am trying to write to an XML file and need to ensure that any ampersands are written as &

Does Actionscript have a function to convert this?

Thanks for your advice

Ampersand &
Hey,
I have a problem when adding the & into the url.
i need to figure out a way on how to paste an & from actionscript into a URL.
Without using %26 or & , because & breaks the url link in actionscript / javascript.
is there a way that i can add or declare the & as a variable or string or something?!

for example:
else if (y==3) {
var = &;
link=_root.clickTAG + & +"gradyear=" + container.optionlist.year2;
getURL(link,"_blank");
}
that dosent work but im hoping somebody gets the ideo of what i am trying to do:
i want the url to look like this for example
http://www.school.edu/?brf=&gradyear=1997

I tried it with the %26 but i dont get the desired effect.

Please help,
im pulling my hair out at this point,

best,
V

Can´t See Ampersand
Hi, I´m loading a text from an external text file and I need to publish the final movie in Flash 6. Everything works fine but some of the text has &, and I don´t know how to show it in Flash. I´ve tried Unicode and Utf-8 with u0026, &, & and they don´t work.

Does anybody know how to show the & character in Flash?

Thanks.

Freakin Ampersand
alright...this should be easy.

I'm loading an external .txt file into a dynamic text field. Everything works fine. The problem is that I need to use an "&" (ampersand) as a text character and flash keeps cutting off the text file at the "&" character cause it's looking for another variable. How do I get it to read the "&" as a text character??

Someone help...

Ampersand Problem - HELP
HELP!!!

Im reading an external text file using flash. This text file is created using php and is updated constantly. It contains refering pages to my website and have numerous &'s in it. I know that there is a way to replace ampersands with %26 in the text document BUT this does not fix my problem as I would have to constantly download my text document and sub %26 for the &'s.

Is there a way using actionscript that I can have flash simply ignore the ampersands?

Thanks

Ampersand Issues
I have a PHP document feeding flash but I can't put in ampersands (needed for links) I realize that you use them to denote a new variable but is there any way to escape that?

Ampersand Problem - PLEASE HELP
HELP!!!

Im reading an external text file using flash. This text file is created using php and is updated constantly. It contains refering pages to my website and have numerous &'s in it. I know that there is a way to replace ampersands with %26 in the text document BUT this does not fix my problem as I would have to constantly download my text document and sub %26 for the &'s.

Is there a way using actionscript that I can have flash simply ignore the ampersands?

Thanks

Disable Ampersand(&)?
Hey Guys,

I'm loading some external text from a .txt file into a Flash (player 7) site and can't remember the code to disable ampersands (&). I remember the script is very simple, which makes my forgetting it even more painful. Its just one line!

Please help before I pull my hair out,
Adam

Pesky Ampersand
Hi, need to load a variable into flash which is a dynamic link - the url I have been supplied with (external company) is sending us & seperated string, which I spot straight away is gunna be split up in flash

Without coming up with a temp fix of joinging the 2 vars back together in flash (cos tehy may change) - is there anyway of setting the & to I dunno some kind of URL encode or Ascii for it to work - Im being fed

clickUrl=http://domain.com/click?p=10606&a=132234

Ampersand (&) In Text From Textfile?
When reading variables out of a textfile, the different variables are separated by ampersands (&). Now what if I want the text in a variable to have an ampersand? How can I prevent Flash from reading it as a separator from the next variable? Same thing with the equal sign (=).

Can anyone help?

Thanx a lot!

Ampersand In External Variables..? Is It Possible..?
Hi,

When I load variables from an external file all variables
are devided by a ampersand ( & ). But what should I do if
I want to use an ampersand in a text-string like
"Barry & Flash" in a variable...? Is that possible?

Ampersand String Variable
weird title for this thread maybe.. ?

I'm using an MC with a button in it. The MC (onLoad), fills the text in.. however.. it doesn't seem to do certain characters, like '&'.

Anyone help?? Do I have to encode the string text?

The Killer Ampersand & Question
Read a few comments and answers to the & problem, but none seem to work.

Heres my snippet of code.

flashmovie.swf?data1=part1&data2=pa&rt3

How do I make that & in the pa&rt3 stay part of the data2 variable

Ive tried the %26, the & the & none of em work. Whats the real trick to doing this. Also, im having a smiliar problem with the question mark, but im guessing the solution to this will be the solution to that too. Thanx in advance

Using An Ampersand In Dynamic Text
Is there a way to use an "&" in dynamic text without Flash thinking that is specifies a new variable?

ie.,

&resortname=Some Resort Hotel & Spa

Flash thinks that "& Spa" starts a new variable.

ideas??

How To Escape An Ampersand In A Txt Document
Hey there -

I'm loading text into my swf from text files on the server. My text is HTML-enabled and I'm trying to enable the printing of such things as accented e's and other accented letters, as there are many of them in my text. How do i escape ampersands in the variables I"m storing in the text files? Please help. Thank you.

Cannot Remove Ampersand From String
Please help! I'm importing a text file which will contain ampersands and need to replace them with a String.prototype function. I've tried about 100 and nothing is working:

Here's my Flash file code (Flash 8, Actionscript 2, all code below on the first frame):

String.prototype.replace = function (searchWord, replaceWith) {
var myString = this, myString2, pos, replace;
if (myString == "" || searchWord == replaceWith) return;
if (myString.indexOf (searchWord) != -1) {
while (myString.indexOf (searchWord) != -1) {
pos = myString.indexOf (searchWord);
myString2 = myString.slice (pos + searchWord.length, myString.length);
myString = myString.slice (0, pos) + replaceWith + myString2;
}
}
return myString;
}
var myLV = new LoadVars();
myLV.load("manager.txt");
myLV.onLoad = function(success) {
if (!success) {
trace("Failed to load");
} else {
test = this.Featured;
test = test.replace("&", "and");
trace(test);
}
};

stop();

My test text file contains only this line:

&Featured=Featured/Arts & Crafts&

PLEASE HELP as I am about to lose my mind. Thank you in advance.

Ampersand In The Key Of An Associative Array
I noticed something strange when I tried this:


Code:
var o:Object = new Object();
o["black & white"] = 0;
The key and value are not added to the object o. There is no error thrown either. But if I do this:


Code:
var o:Object = new Object();
o["black & white"] = 0;
it does work. The debugger shows the key (member variable) as black & white and the value as 0. Is this normal, because I sure did not expect it. Clearly the ampersand IS supported, but why do we need to use an entity like we do in XML?

Ampersand Character Not Showing?
Hello,

I've been working with updates on a Flash based design that pulls content from a remote MYSQL database server. I recently had an auto-update script installed (by an IT consulting company) that works great....but I've noticed since this time that any '&' ampersand symbols do not convert to show correctly. If you view a page in the browser all ampersand symbols now show as '&'.

Is it possible the UTF setting needs to be changed to work with the php update script? Has anyone heard of this problem before?

My experience is in html and handling content updates, so Flash scripting and php is out of my realm, but I'm trying to confirm what the issue might be to prevent our consultant from going over budget. I've done numerous online searches but haven't come across specific mention of this problem yet.

Ampersand In External Text File
Howdy Geniuses!

I am trying to have "AT&T" loaded from an external text file. It only loads "AT" and then stops because the "&" screws it up. I tried using & to no avail. Maybe I am doing it wrong. I was trying to do it this way: AT&T

That should work but it does not Any ideas?

Thanks

Dynamic HTML Ampersand Problem
I have been searching this all morning and still have yet to find a resolution, so I appologize if a fix has been posted. I am using a dynamic news feed and importing html into a dynamic field. I do not have control over the outside content other than to wrap it w/ a <p></p>... etc. I have been getting feeds from time to time that contain & with in the content. Is there a way in LoadVars, to have flash replace ampersands on the fly if they exist in the dynamic content. I have complete control over what to wrap it with so if its easier to do this xml and help with pointing me in the right direction would be great. If there is away to do it in XML, I also need href's to work to be able to point to the article with new window. Any help would be great. Have a good one.
Thanks,
Matt

HERE is a sample feed:
news=
<b>Baseball</b><br><br><b>Paradise City is in Pullman</b><br><P>In Honolulu, the sweet smell of flowers blown by trade winds tantalizes one's nose.
Junior guard Derrick Low might have ignored that fact when he opted to trade paradise for a chilly purgatory, but his decision to attend Washington State, despite never being there, has the Pacific- 10 Conference in an altered state.
Sparked by Low's scoring and experience, Wazzu has taken the headlines away from Gonzaga and Pac-10 brethren Washington in the Evergreen State, and created quite a stir.</P><br><b>Hot Off the Press</b><br><P>CSUN hires assistant AD
Cal State Northridge has hired Bob Vazquez as its new assistant athletic director in charge of athletic media relations.
Vazquez, a longtime and well-respected media relations director at Stanford, replaces Ryan Finney, who left CSUN over the summer to become the assistant director of sports information at UCLA.</P><br><b>Briefly</b><br><P>UCLA interviews Cignetti for offensive coordinator job
Former Fresno State and North Carolina offensive coordinator Frank Cignetti interviewed with UCLA coach Karl Dorrell about the Bruins' offensive coordinator position, sources said Wednesday.
Cignetti, who also was quarterbacks coach, was not retained by new Tar Heels coach Butch Davis.</P><br><b>Blue Jays Reach Agreement With P Ohka</b><br><P>Toronto, ON (Sports Network) - The Toronto Blue Jays made it official on Thursday, signing pitcher Tomo Ohka to a one-year, $1.5 million contract.
The deal was first reported on Wednesday, but Ohka needed to fly from his native Japan to Tampa pass the appropriate tests.
He finished with season with a record of 4-5 with a 4.82 earned run average.</P>

Ampersand In Context Menu Problem
Is there anyway to get the ampersand to show in the context menu. It's a simple string and I don't understand why it sees the ampersand as code instead of text. I've attached the affected code. Please help a newbie out!
Thanks!
JK







Attach Code

function deadClick () {
}

var myMenu:ContextMenu = new ContextMenu();

var copyrightNotice:ContextMenuItem = new ContextMenuItem("©2006 Name & Name", deadClick);

Using LoadVars To Retrieve XML But Ampersand (&) Messing It Up...
i dont want to use XML object for this. Is there anyway at all to make my xml format come back correctly. the ampersand seems to be calling loadvars to think its a different variable obviously.

any way aroun dit?

my simple php script is:

PHP Code:



<? $firstName = $_GET['firstName']; $lastName = $_GET['lastName'];   print "&returnFirst=". $firstName . "
"; print "<xmltype>
"; print "<one>http://www.fakesite.com?returnMe=fuzz&returnResult=boom</one>
"; print "</xmltype>
"; print "&returnLast=". $lastName . "
"; ?>




my as file is:

PHP Code:



var sendForm:LoadVars = new LoadVars();sendForm.firstName = "John";sendForm.lastName = "Smith";sendForm.sendAndLoad("test.php",sendForm,"GET");sendForm.onLoad = function(success){    if(success){        myXML = new XML();        myXML.ignoreWhite = true;        myXML.contentType = "text/html";        myXML.parseXML(unescape(this));                mytxt.text = unescape(this);    }}; 




my output is:

PHP Code:



returnLast=Smith&returnResult=boom</one></xmltype>&returnFirst=John<xmltype><one>http://www.fakesite.com?returnMe=fuzz&onLoad=[type Function]&lastName=Smith&firstName=John 

Using Ampersand (&) Sign In Dynamically Loaded Text
If i have an '&' in my text everything afterwards disappears. I tried using & but no dice.

The dynamic text is treated as HTML and the text file starts out as &mytext=

Thanks for any help!

Loading External Text Issue With Ampersand
I am loading external text and inside the text there is an ampersand (&), I think Flash thinks this is a new variable or something because it stops there... Anyone had this issue before? I have embedded all the fonts...

Have You Ever Imported An Ampersand Symbol Via A Text Or Xml File Using AS3?
I've been asking around and it appears this is sort of hard to explain and I can't figure out why.

All I'm trying to do is import text dynamically from XML file -- but I need to include a double-right arrow (»).

I can extract the text and import it to Flash in a dynamic text box no problem, just can't figure out how to include the entity reference in XML (using CDATA causes errors or stops any text from showing in the text box at all).

Maybe I'm not using CDATA correctly, does the XML file need a specific XML header to work correctly?

Would just think people need to do this automatically and there would be a lot of resources on it.

Thanks for any help.

Dynamic Text - Loading A Literal Ampersand
I am only beginning to learn Flash.

I have dynamic text boxes, reading a variable from a text file. It works fine, however, I want to read a string that contains a "&" - like "M&Ms" or something. & (the HTML code) or & or && do not work.

Anyone have any idea how I can do this?

- LJHarb

Problem With Loading External Text. > Next Line Symbol + Ampersand
Hi there

As i am working on my new site, i've encountered some troubles which i can't seem to fix easely.

first off: I import my text through a .TXT file , this allows me to add html tags to the texts fe. < b > < i > etc.
example of the txt file : &content=this is the text to be shown.
i load in flash mx 2004 with this script

Quote:




myData = new LoadVars();
myData.onLoad = function() {
myText_txt.htmlText = this.content;
};
myData.load("text.txt");

stop();




question 1: how can i now use the & symbol in my text? i tried the html code( & ) for it but it won't work.
question 2: how do i place a "soft return". when i put <br> i get lines like this:


Quote:




and then this line

and then this line




so the whitespace is way too big, i tried <p> <br>
^n, it all doesn't work.

i ask this because i need to make a scrollable tracklist of a mix
fe.
saphir & zief - ashfall - complex beatz
total science -mainline VIP - media::recordings
dylan & ink - need you re- amen edit - outbreak
photek - sidewinder - photek
danny c - i got what you need - creative source

i hope this explanation is well put so i can get any help on this.
a guider and or wise words would be appreciated.

kind regards
P

LoadVariables: Can Two LoadVariables In The Same Script Cause A Problem?
Hi,

It seems that for some reason, my attempt to send vaiables is not working. I'm not certain if its my syntax or the fact that I have a second loadVariables later in my script(with a different name of course). help?

heres a sample of the script that I'm using:

ClickedSendVar = new loadVariables();
ClickedSend = "bob="+bob+"&fred="+fred+"&jim"+jim;
ClickedSend.send(_root.on_card, ClickedSend, "POST");

The Infamous "securitySandboxError"
I do FileReference uploads regularly and have heard other people complain about this but have never gotten it myself. I do not understnad why i am getting it now.

I can test the file upload from the SWF locally(with php online) and it works fine. However when i upload the SWF and then try running it from the server, it gives me the securitySandboxError.

I have tried changing from "access local files only" to "access network only" in the publish settings. But other than that i can't figure it out.

Theres no point in setting up a cross-domain policy as well... it doesn't work on the same domain, but somehow works when it is on another domain(my computer).

If anybody has any ideas, i'd love to hear them. I know this is a bit advanced but i'm sure somebody out there knows, Sen? Canadian?

HELP ME~~~ The "&" (ampersand) Problem
Dear all,

I am a newbie in flash 5. The other day i was trying to do a project using flash to dynamically call external text file (.txt) and loaded the variables data into the dynamic text field .

Everything is fine but except that i couldn't include the special character "&" (ampersand) in the text file. If i have included it, the rest of the wordings will be truncated.

For example, i have done a flash header that can be dynamically modified using the text file (with the dynamic text field named "mainTag"):

"mainTag = MY NEW SCHOOL PROJECTS"

This loads perfectly in the exported SWF file.

However, if I add in "&",e.g.

"mainTag = MY NEW SCHOOL PROJECTS & ASSIGNMENTS"

the word "& ASSIGNMENTS" will be left out during the preview of the SWF file.

Is there is any method to solve this problem? Can anybody help out? Thank you all very much in advance.

HELP ME~~~ The "&" (ampersand) Problem
Dear all,

I am a newbie in flash 5. The other day i was trying to do a project using flash to dynamically call external text file (.txt) and loaded the variables data into the dynamic text field .

Everything is fine but except that i couldn't include the special character "&" (ampersand) in the text file. If i have included it, the rest of the wordings will be truncated.

For example, i have done a flash header that can be dynamically modified using the text file (with the dynamic text field named "mainTag"):

"mainTag = MY NEW SCHOOL PROJECTS"

This loads perfectly in the exported SWF file.

However, if I add in "&",e.g.

"mainTag = MY NEW SCHOOL PROJECTS & ASSIGNMENTS"

the word "& ASSIGNMENTS" will be left out during the preview of the SWF file.

Is there is any method to solve this problem? Can anybody help out? Thank you all very much in advance.

XML And The Ampersand "&"
I'm importing an ampersand symbol and can't get it to display normally in flash. I've trying turing it into a string, and System.useCodepage = true;. Also I've tried making the text fields html = true. But still nothing, any ideas?

LoadVariables From CGI
Why does it work from my HD, and not on the Web.

When I run the SWF in flash it load the vars ok. Then I tested outside Flash, in the Flash PLayer, and in the Browser both from the HD. The file was on my HD but the script still gets the vars from a valid URL.

I load the vars like this:
loadVariablesNum ("http://www.mydomain.com/cgi-bin/flashclock.pl", 1);

In the dubugger window, all the vars are loaded correctly only when the file run from the HD.
Then I run the (SWF) file from the web, and the debugger window only show me the _level0 objects and vars. NOTHING from _level1 (to witch i'm loading them).

I tested the PL right in the browser to, and it outputs everything correct, like:
&name=paul&weight=85&...

Is loadVariablesNum a wrong method to get the vars from a pl file.

H E L P !!!!

LoadVariables + Php
I have this tiny PHP script that I would like to call in order to generate a string to be used as a variable:

Code:
<?php
// filename is 'metar.php' located on server 'your_url_here'
echo "metar=";
$fp = fopen ("http://weather.noaa.gov/pub/data/obs...tions/CYUL.TXT", "r");

// The above URL retrieves the latest weather data for Montreal's Intl. Airport.
// Hack the source at http://www.gimpster.com/php/phpweather/index.php PHP Weather for how to interpret the value.

while (!feof ($fp)){
$metar = fgets($fp, 4096);
echo $metar;
}
fclose ($fp);
?>
In my flash movie, I call that script on fr.1 using

Code:
loadVariables("http://your_url_here/metar.php", "");
and I have a dynamic text field which is linked to the variable metar.

Of course it doesn't work so far. Any pointer why and/or how to make it work?

thanks and cheers

D.

LoadVariables Bug?
Im getting feed back from my users that when they try to login it hangs.

all im doing is a simple task they type userid and pass click next

loadvariables from a CGI script which checks the userid and pass sends back a responce of either wrong or ok

while flash is waiting for this responce i do this.

if (responce eq "ok"){
gotoandplay("ok")
}
elseif(responce eq "wrong"){
gotoandplay("wrong")
}
else{
prevframe
}

#################
the previous frame is just a play() to check the status again.

so why is it hanging? is there any know problems with this method like using it in different browsers or platforms??

or if anyone has a better method i will be happy to listen.

Danny

LoadVariables
Hello,

I have 10 frames in my movie and each frame has 2 loadvariableNum command to load text into 2 different dynamic text boxes in my main movie. 1 loadvariableNum command looks for data from the database and the other from a text file. When I try it out, only 1 LoadVarNum command works, meaning that text var 1 will populate with text but not text var 2. I have both variables loading into level_0. What is the processing order for LoadVarNum command? Is there a certain order that they load in?

Loadvariables Help
I have a simple menu on a page called menu.html with four selections (red, yellow, green and orange). This opens a pop up window (menupop.asp) with the following code:

<%color = request.form("color")%>
<script>
var color = "<%=color%>"
</script>

This page has a flash movie with the code:

stop ();
loadVariables ("menupop.asp", "0", "POST");
gotoAndStop (color);

There are four frames with labels red, yellow, green and orange, but is not going to the right frame.

Any solutions?

I'll try to upload the pages later (my server's being a pain).

-Brandon
[Edited by bugkarma on 10-16-2001 at 02:00 PM]

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