Search Text Loaded Via Loadvars
Ok I know how to load text from a text file into flash but how do I search the loaded text for a certain word and then do an action if the word is found?
FlashKit > Flash Help > Flash ActionScript
Posted on: 05-17-2007, 07:17 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Text Loaded With LoadVars
I want to make a guestbook, so I have made a flash, php file and a txt file.
I use php to save the new message into the txt file. ( It's work!! )
However, when I want to load the message inside the txt file, i used the LoadVars object.
Since the message is in html, I added a code:
myData=new LoadVars();
message_txt.htmlText=myData.entries;
And my txt file is like that:
&entries=<font color="#FFFFFF">Name:</font> Admin
<font color="#FFFFFF">Email:</font> <font color="#990000"><u><A href="mailto:Admin701@yahoo.com.hk">Admin701@yahoo .com.hk</A></u></font><br>
<font color="#FFFFFF">Posted:</font> 08/22/05 03:06 PM
<font color="#FFFFFF">Message:</font> Write entries here
But after the flash player have loaded, text shown in message_txt became....(all things are still here)
font color="#FFFFFF">Name:</font> Admin
<font color="#FFFFFF">Email:</font> <font color="#990000"><u><A href="mailto:Admin701@yahoo.com.hk">Admin701@yahoo .com.hk</A></u></font><br>
<font color="#FFFFFF">Posted:</font> 08/22/05 03:06 PM
<font color="#FFFFFF">Message:</font> Write entries here
Am I miss sth. in the script ?
Search And Replace Text Loaded From A .txt File?
I'm sorry if this has been asked before, but I haven't been able to get the search feature to work for the past few days...
I'm using Flash 5 to create a projector (.exe) that will display a computer's IP configuration. So far, I've used the following code to export the computer's IP configuration to a text file named "textfile.txt" (this code is in the main timeline):
Code:
fscommand ("exec", "cmd.exe /c echo importText=> textfile.txt&&ipconfig>> textfile.txt");
The output text file (textfile.txt) is created, and contains the following:
Code:
importText=
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : whatever.whateverelse.com
IP Address. . . . . . . . . . . . : 1.1.1.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 1.1.1.1
Ethernet adapter AGN Virtual Network Adapter:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 0.0.0.0
Subnet Mask . . . . . . . . . . . : 0.0.0.0
Default Gateway . . . . . . . . . :
Next, I import the text file into my dynamic text box (importText) using this code (from the main timeline):
Code:
loadVariables ("textfile.txt", importText);
Everything displays fine in my dynamic text box up to this point. Now, what I want to do is have Flash highlight the name of each ethernet adapter. So, in my example above, I would want it to display everything in the dynamic text box, but I want the text "Local Area Connection" and "AGN Virtual Network Adapter" to be a different color, so they stand out.
Does anyone know of a way that I can have Flash search through the imported text from the text file and then change the color of certain characters/words?
I think that it's going to have to search for the phrase "Ethernet adapter ", then change the color of everything following that text until it runs into the colon ( : ) following the adapter's name. Does anyone know how I might accomplish this?
Thanks a million in advance! This one has really got me stumped!
Formatting Text Loaded With LoadVars();
I am dynamically loading text with LoadVars from an external txt file. Here is my script:
var lvText = new LoadVars();
lvText.load("data.txt");
lvText.onLoad = function(bSuccess:Boolean) {
tInfo.text = this.data;
if (bSuccess) {
trace("text loaded");
}
};
I can easily add new text to the TextField in my SWF file, however, formatting seems to be a problem. I can format text with HTML tags, CSS or TextFormat object before publishing the SWF What I really need is to somehow apply the formatting to the external txt file without remaking the SWF... I tried adding HMTL tags to the txt file, however, flash just treats them as string data... how can I make it recognise the tags?
Search Help Text Search In Flash
Hello, i'm realy stuck, and I need help... read dead end , i need to make a search on my site in flash, and also i need to explain ... what i need , example, whole site is in flash, and i need when someone wonna to find something just type word or sentence and then find on my site, but not google find or something like that... i wonna something easy, like CTRL + F, but label with find button... if anyone can help me or give me a guide i will be so happy, so thanks
sorry for my english... I hope it's readable )
LoadVars.loaded, Help
Hey guys!
I have somo problem on my project.
When I use "Metodo()" (below) it doesn't have time to load to the class variables all the info picked up from the file. If I use a button calling "Metodo()", then it give some time to load it, but I need this "Metodo()" just iin time that the frame starts.
I've tried to use
Code:
while( !(this._dadosRecebidos.loaded) );
but it doesn't work either; it gives me an infinite loop!
How can I proceed?
The TComunicacao class source follows bellow:
Code:
import mx.utils.Delegate;
class Comunicacao.TComunicacao
{
private var _var1:Number;
private var _var2:Number;
private var _var3:Number;
private var _dadosRecebidos:LoadVars;
private static var ARQUIVO_DADOS_RECEBIDOS:String = "dadosRecebidos.php";
//-------------------------------------------------------------------------
public function TComunicacao()
{
this._dadosRecebidos = new LoadVars();
this._dadosEnviados = new LoadVars();
this._carregou = false;
this._dadosRecebidos.onLoad =
Delegate.create(this, this.AoCarregarDadosRecebidos);
this._dadosEnviados.onLoad =
Delegate.create(this, this.AoCarregarDadosEnviados);
this.CarregarDados();
}
//-------------------------------------------------------------------------
public function AoCarregarDadosRecebidos(success)
{
if (success) {
this._var1 = this._dadosRecebidos.var1;
this._var2 = this._dadosRecebidos.var2;
this._var3 = this._dadosRecebidos.var3;
}
else {
_root.output.text = "Arrrrghhh!";
}
}
//-------------------------------------------------------------------------
public function CarregarDados()
{
this._dadosRecebidos.load(ARQUIVO_DADOS_RECEBIDOS);
}
//-------------------------------------------------------------------------
public function Metodo()
{
if(this._dadosRecebidos.loaded) {
_root.output.text += "Vars loaded from PHP:
";
_root.output.text += this._var1 + "
";
_root.output.text += this._var2 + "
";
_root.output.text += this._var3 + "
";
}
else {
_root.output.text += "
No data here!";
}
}
};
Search Dynamically Loaded Csv File
Greetings!
I'm trying to figure something out and am not sure how to go about it. Currently, I have a .fla that dynamically loads a four column .csv file. I would like the user of this this to be able enter a search term that relates to the first column of the .csv file, which is always going to be five digit number.
Is there a way to script this search from the .csv file and have it display the other three fields that are related to the search term?
I'm using MX 2004 pro by the way.
Thanks in advance for any assistance you can provide.
- - Jeff
LoadVars() And GetBytesTotal And Loaded
Code:
loadVarsText = new LoadVars();
loadVarsText.load("text.txt");
loadVarsText.onLoad = function(success) {
total = loadVarsText.getBytesTotal();
totLoaded.text = this.getBytesLoaded();
if (success) {
_root.finish = "done loading";
gotoAndPlay(2);
scroll.text = this.varText;
} else {
_root.finish = "not loaded";
}
};
I´m using the code above to load a textfile.
Now I want to show getBytesLoaded in a texfield to see how much of the textfile is loaded but I can´t get the textfield to be updated.
When I start the flashfile the two textfields with getBytesTotal and getBytesLoaded displays nothing and when the hole file is downloaded complete, then I see the values in those texfilelds.
How do I do to display the percentage of the file when it´s downloaded??
LoadVars - How Reliable Is 'loaded'?
hi everyone
myloadVar.loaded will be true when the communication has finished successfully. but is that reliable? a package loss over the net is possible when sending AND receiving. so.. .when i am sending a variable to a php-script by using myloadVar.send(), can i be sure that this variable did not get to the serverscript after one or two minutes if that loaded-flag keeps being false?
if not, what possibility do i have to be sure, if a variable could be delivered or not to the serverscript?
thx
mario
LoadVars.Loaded As A Preloader
Does this make sense?
myButtonTxt = new LoadVars();
myButtonTxt.load("file.txt");
if(myButtontxt.loaded==true){
play();
}
If not, what does (reletive to this, I mean)?
LoadVars GetByteTotal And Loaded
Hi there...a quick one
How would I use the loadVars() to load a .swf and show the progress(in percent) and start the swf after its loaded..?
thanks ,,,
LoadVars Object Never Loaded
I am using the loadVars object to load a jpg, before using the loadMovie function to load it into my movieclip, upon success of the load.
I also use another movieClip to track the amount of data loaded into the loadvars object (with the getByteLoaded, getBytesTotal), and sometimes the load gets stuck, and actualy is never loaded. (onLoad is never called back) The percent loaded varies between 15 and 45. The getBytestotal is returning a valid number.
I have tried to set a number of retry to load the jppg when the loadVars object had not loaded for more than x seconds, but the retry is NEVER successful.
I have therefore increase the time I allow to loadVars object to be "loaded" to 10 seconds, but it seems that it always gets stuck after just a second and giving 10 second does not make any difference.
What could be the reason for that?
It seems to be happening more on the mac than the pc, and more on mozilla than safari on the mac, more mozilla than ie on the pc.
I read about loadVars failing loading jpg on "aol" browser, whatever that is, for a mimeType reason(???). Is that relevant ?
Thank in advance for your advices.
BTW: worst yet, sometime I have to reload my page quite a few time to see the Flash showing up? Could that be part of the same problem?
geraldine
LoadVars.loaded Always Undefined
Hi there,
I have:
Code:
lv = new LoadVars();
lv.pageIndex = pageIndex;
lv.sendAndLoad("List_NewsStories.aspx", result_lv, "GET");
trace("loaded: " + lv.loaded);
And it always outputs 'undefined' even in the onLoad handler.
Any ideas?
Need To Detect What Is Loaded From LoadVars
i'm working on a site that requires the menu button text labels to be loaded dynamically. Since it's a menu, i need to have buttons for each of the text labels that do load and none for any of the text labels that are left blank.
-----------------------------------------------------------
here's the AS i have on the first frame of the menu swf:
myData = new LoadVars();
myData.load("menu/menu01.txt");
myData.ref = this;
myData.onLoad = function(succes) {
if (succes) {
for (var i = 0; i<this.cant; i++) {
this.ref["title_txt"+i].htmlText = this["Title"+i];
this.ref["link"+i].htmlText = this["link"+i];
}
} else {
trace("Error loading data");
}
};
----------------------------------------------------------
which loads this text from menu01.txt:
Title0=Sanitaarkeraamika&link0=Artceram&link1=Cata lano&link2=&link3=&link4=&link5=&link6=&link7=&lin k8=&link9=&link10=&link11=&link12=2 more after this one&link13=almost the end&link14=end&cant=15
-------------------------------------------------------------
i was thinking of using the button._visible = false (or true) to have the button either show up when a text label has been loaded or not show up when a text label hasn't been loaded. but can't figure out how to write th AS to let Flash know which text is blank.
any thoughts and sugestions?
i'm in serious trouble here ... deadline is coming closer.
thanx
Please HELP: Loadvars Object Inside Loaded Swf
Hi, I have a hard time figuring this out...
I have a main movie that loades a submovie with the loadMovieNum command...
Inside this loaded movie I have some actionscript that loads some data from a text file using the loadvars object and puts it in a text field
now.. if I run the loaded movie bi itself everything works fine... if I run the main movie, the loaded movie seems to be unable to access the loaded data... although the onLoad function gets called and receives true.. just as if the data was loaded correctly...
please note that I am using all relatives paths and stuff.. and that the loaded movie actually sees the local loadvars object fine..
If I set some properties manually, like myLoadVars.test='testing';
the loaded movie accesss those properties just fine and prints them in the text field... but the loaded property is just not there....
I am really clueless.. any hint...?
Thanks so much in advance
Sergio
////Code follows
function get_data_file(zlan)
{
//loads different file depending on language
var datafile;
switch(zlan)
{
case 'it':
datafile="comp/comp_it.txt";
break;
}
zmyLoadVars.load(datafile) ;
}
function settext(ztext)
{
mytext.text=ztext;
}
zmyLoadVars = new LoadVars();
zmyLoadVars.test='testing';
zmyLoadVars.onLoad=function (suc)
{
if(suc)
settext(this.toString());///the test property gets printed but no loaded data
//settext(0);
else
settext('uh uh problem loading file');
}
//mytext.text=_parent.lan;
get_data_file(_parent.lan);
stop();
Refreshing Loaded Data With LoadVars
Hey Guys,
Ok so I'm using a Flash front end, ASP connection and Microsoft Access Database.
When i load up my Flash program I can query the database and dynamically create a table of all my entries on the screen.
Then I can go and edit an entry and send it back to the Database to update the entry.
(Also works. I tested by checking the database manually and restarting the flash program.)
My problem is that I'm calling my query function again after updating the database because I want to refresh the visible data.
But when I call it, it doesn't work and I have to restart the flash program before I can see the changes I made.
Here is my query function:
Code:
function loaderUp() {
//incoming is the LoadVars Object
var incoming = new LoadVars();
//loads the asp page that will query the database
incoming.load("http://loader.asp");
//once loaded... fire checkLoad to create table
incoming.onLoad = checkLoad;
}
And here is my send function that happens later:
Code:
//submits the changes to the database
function submitUPD() {
//creates a new LoadVars Object
var outgoing = new LoadVars();
//assigns the two variables we want to pass to the ASP
outgoing.subText = _root.IText.IText2.text;
outgoing.numKey = _global.ext;
//removes the editing tools
_root.IText.removeMovieClip();
_root.Submit.removeMovieClip();
//sends the values and triggers the ASP to update the database
outgoing.sendAndLoad("http://submit.asp", outgoing, "POST");
cleanUp();
}
Again this works fine... here's cleanUp()
Code:
function cleanUp() {
//removes the movie clips showing table data from the stage
for (var i = 1; i <= _global.numOfRec; i++) {
_root["ItemA"+i].removeMovieClip();
}
//requeries the database and shows the new data
loaderUp();
}
So after changing the data and cleaning up the stage I want to query the database again and show the new data.
But when i do it, it only shows the old data.
(I've also tried setting timers and buttons to play around with waiting for the database to be written to. No luck.)
The other idea I had was to create an array of LoadVar objects. So
loadedArray[count] = new LoadVars();
loadedArray[count].load etc etc.
But this wouldn't work either.
Thanks for any help you can give.
LoadVars.onload() --> Check If It's All Loaded?
Here's my test file:
http://rwocreative.com/arrayTest/arrayTest01.html (Use IE to view it, stupid Safari *grumble grumble*...)
Here's my code:
Frame 1:
PHP Code:
//stop();
//VARIABLES
var rank_id = new Array();
var dir = new Array();
var name = new Array();
var description = new Array();
var tdir = new Array();
var tname = new Array();
//var count;
//selRank: value that is changed whenever you click a thumbnail
var selRank = 1;
_global.maxCount;
//LOAD PHP SCRIPT
myData = new LoadVars();
myData.load("php/load_celebrity.php");
//myData.load("loadfake.txt");
myData.onLoad = function(success) {
if(success) {
trace("myData.onLoad = success");
for(var i=0; i<this.count1; i++) {
//Flash variable side || PHP variable side
rank_id[i] = this["rank_id"+i];
dir[i] = this["dir"+i];
name[i] = this["name"+i];
description[i] = this["description"+i];
tdir[i] = this["tdir"+i];
tname[i] = this["tname"+i];
_global.maxCount = this.count1;
}
} else {
trace ("Error loading data for query.");
}
};
Frame 10:
PHP Code:
stop();
var widget;
selPic = 0;
//trace("_global.maxCount = "+_global.maxCount);
for(i in rank_id) {
trace("rank_id["+i+"] = "+rank_id[i]);
trace("dir["+i+"] = "+dir[i]);
trace("name["+i+"]: "+name[i]);
trace("description["+i+"]: "+description[i]);
trace("tname["+i+"]: "+tname[i]);
trace("tdir["+i+"]: "+tdir[i]);
trace(" ");
}
//POPULATE THE MOVIE CLIPS ON-STAGE
while(selPic<maxCount) {
widget = rank_id[selPic];
loadMovie(tdir[selPic]+tname[selPic], ["t"+widget]);
if(widget==selRank) {
textHolder_txt.text = description[selPic];
loadMovie(dir[selPic]+name[selPic], holder_mc1);
}
this["dir"+selPic].text = dir[selPic];
this["name"+selPic].text = name[selPic];
this["description"+selPic].text = description[selPic];
selPic+=1;
};
//Add in an if() loop HERE to check if the movie clips are done populating
if(selPic >= maxCount) {
//trace("selPic = "+selPic+" and _global.maxCount = "+maxCount);
gotoAndPlay("go");
}
Frame 11:
PHP Code:
stop();
Here's my problem:
The file I've got above works, technically, but it only works if I push the loadMovie functions waaaay out several frames. Is there a way to detect when the var.onload() finishes parsing all the data to the separate arrays? I'm sure pushing the loadMovie out a few frames is workable for a small file, but if I work with a larger text file then there'll be problems.
Thanks!
Please HELP: Loadvars Object Inside Loaded Swf
Hi, I have a hard time figuring this out...
I have a main movie that loades a submovie with the loadMovieNum command...
Inside this loaded movie I have some actionscript that loads some data from a text file using the loadvars object and puts it in a text field
now.. if I run the loaded movie bi itself everything works fine... if I run the main movie, the loaded movie seems to be unable to access the loaded data... although the onLoad function gets called and receives true.. just as if the data was loaded correctly...
please note that I am using all relatives paths and stuff.. and that the loaded movie actually sees the local loadvars object fine..
If I set some properties manually, like myLoadVars.test='testing';
the loaded movie accesss those properties just fine and prints them in the text field... but the loaded property is just not there....
I am really clueless.. any hint...?
Thanks so much in advance
Sergio
////Code follows
function get_data_file(zlan)
{
//loads different file depending on language
var datafile;
switch(zlan)
{
case 'it':
datafile="comp/comp_it.txt";
break;
}
zmyLoadVars.load(datafile) ;
}
function settext(ztext)
{
mytext.text=ztext;
}
zmyLoadVars = new LoadVars();
zmyLoadVars.test='testing';
zmyLoadVars.onLoad=function (suc)
{
if(suc)
settext(this.toString());///the test property gets printed but no loaded data
//settext(0);
else
settext('uh uh problem loading file');
}
//mytext.text=_parent.lan;
get_data_file(_parent.lan);
stop();
About Search Engine Optimization (html Loaded In Flash)
Hey all.
Bottomline is I'm redesigning my portfolio website that I haven't been updating for quite sometime. One reason is design and the other is search engine optimization; it used to be (and the current online version is) all flash but now I'm making a version using html and flash.
The only html page is the index one and it has almost all the text but the remaining is a flash movie hidden in a div that loads section swf's. Finally these section swf's use xml documents to gather data.
Since xml documents are not indexed by the engines, I thought maybe choosing rather html documents over the xml ones would be better but I still don't think these will be indexed by the engines because they are not directly linked in the main page. My question is, do you think they will be considered because they are used anyway and they exist in the relevant directory? What if I make a site map page and load it in a div in the main page? Do files loaded with, say AJAX get indexed?
Thanks in advance.
LoadVars - Passing Vars To External Loaded SWF
I load my vars with LoadVars in main SWF and would to like use the loaded variable in later loaded SWF.
I can´t find how to find the right path to my txt field in this loaded SWF.
E.g.
I load ext. SWF in mc container_images_of_pools
In root of this ext. SWF I habe txt field txt_pools_plastic
Thanks
[CS3] Displaying Non-english Characters Loaded With LoadVars
I am making a website in Swedish. I have used LoadVars to load in variables for the text of the pages.
this is one of the variables the textfile contains
Quote:
&textPage1Sve=detta är på svenska.Detta är ett test för att se om ÅÄÖ visas korekt.
but it is incorrectly displayed in the flash movie. like this:
Quote:
"detta p�venska.Detta ett test ftt se om visas korekt."
the loading code is correct but the special swedish characters are not displayed correctly. (åäö)
Can anyone help me with this?
LoadVars - Passing Vars To External Loaded SWF
I load my vars with LoadVars in main SWF and would to like use the loaded variable in later loaded SWF.
I can´t find how to find the right path to my txt field in this loaded SWF.
E.g.
I load ext. SWF in mc container_images_of_pools
In root of this ext. SWF I habe txt field txt_pools_plastic
Thanks
Preloading Contents Loaded By LoadVars Object
Hi guys,
I was trying to create a preloader that preloads content loaded by the LoadVars() Object. For some reason, the getBytesLoaded and getByetesTotal variables of the LoadVars object kept retuning a null value. Below's how I do it:
PHP Code:
var news_lv = new LoadVars();
var url = "news.aspx"
news_lv.load(url);
//////////////////////Preload Content///////////////////////////
var bytes_loaded = news_lv.getBytesLoaded();
var bytes_total = news_lv.getBytesTotal();
var getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
//loadText is the variable name of a textfield that
//resides within the loadText_mov mc
loadtext_mov.loadText = Math.round(getPercent*100)+"% Loaded";
if ( Math.round(getPercent*100) >= 50 ) {
my_color = new Color(loadBar);
my_color.setRGB(0xFF0000);
}
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
//////////////////////////////////////////////////////////////
news_lv.onLoad = function(success)
{
if ( success )
{
//some other codes
}
}
Any clue what's wrong? Thanks in advance.
[AS 2.0 MX PRO 2004] Does Loadvars Work From A .swf That Loaded Into A Preloader
I have Beginning.swf that loads main.swf. Within main.swf I am using loadvars to send data to a .php file. Thus far, I am using
import mx.controls.Alert;
LV.sendAndLoad("http://www.url.com/file.php", loadvarsVariable, "POST");
loadvarsVariable.onLoad = function(){
Alert.show(data, "test");
to see if it will load, and the alert box doesn't appear , So I want to conclude that the call to the .php file isn't going through. Because main.swf is embedded within Beginning.swf, the call won't work. I know that the code works because when I test main.swf by itself, the Alert box appears. I have also ensured that there is an Alert object within the Beginning.swf library. This allows alert boxes from main.swf to appear in Beginning.swf. Does anybody have experience dealing with this? Does anybody know if newer versions of Flash/Actionscript behave any differently than this? Is there a work around for this problem, any Open Source solutions?
Preloading Contents Loaded By LoadVars Object
Hi guys,
I was trying to create a preloader that preloads content loaded by the LoadVars() Object. For some reason, the getBytesLoaded and getByetesTotal variables of the LoadVars object kept retuning a null value. Below's how I do it:
PHP Code:
var news_lv = new LoadVars();
var url = "news.aspx"
news_lv.load(url);
//////////////////////Preload Content///////////////////////////
var bytes_loaded = news_lv.getBytesLoaded();
var bytes_total = news_lv.getBytesTotal();
var getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
//loadText is the variable name of a textfield that
//resides within the loadText_mov mc
loadtext_mov.loadText = Math.round(getPercent*100)+"% Loaded";
if ( Math.round(getPercent*100) >= 50 ) {
my_color = new Color(loadBar);
my_color.setRGB(0xFF0000);
}
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
//////////////////////////////////////////////////////////////
news_lv.onLoad = function(success)
{
if ( success )
{
//some other codes
}
}
Any clue what's wrong? Thanks in advance.
Trouble Assigning Link To Image Loaded With Loadvars In As 2.0
I'm working on a pretty simple image gallery using LoadVars. Images are loaded into a movieclip (framesMC) and I'm trying to assign a link to each loaded image dynamically as well (as the images changes so should the link). So I set up a separate LoadVars (urlLV) to load the URL from a text file and assign it to the movieclip by using getURL once the image has loaded. The text file gets loaded and the image becomes a link but the URL that's linked 1) replaces symbols (periods and slashes) w/ code and 2) also includes the URL of the site where the gallery is. To illustrate an example:
my text file contains: info=http://www.waterloorecords.com
the site hosting the swf of the gallery is [url]www.douglasbenjamin.com[/url]
when I click the link on the site the URL it tries to navigate to is:
[url]http://www.douglasbenjamin.com/info=http%3A%2F%2Fwww%2Ewaterloorecords%2Ecom[/url]
here's code for the gallery:
[code]var curFrameNum:Number = 0;
var slideInfoLV:LoadVars = new LoadVars();
slideInfoLV.load("vars/slide_info.txt");
function loadFrame() {
var urlLV:LoadVars = new LoadVars();
var clipLoader = new MovieClipLoader();
var preloader = new Object();
var slideURL:String;
clipLoader.addListener(preloader)
clipLoader.loadClip("images/web" + curFrameNum + ".jpg", this.framesMC);
_level0.myLV.load("slidetext/web" + curFrameNum + ".txt", this.loadedInfo);
// loading the URL...
urlLV.load("slideurl/web" + curFrameNum + ".txt");
var slideURL = urlLV;
preloader.onLoadComplete = function (framesMC){
framesMC.onPress = function() {
getURL(slideURL, _blank);
}
}
}
loadFrame();
// ----<next slide>---- \
this.nextSlideBtn.onRelease = function() {
if (curFrameNum < Number(slideInfoLV.totalFrames) - 1) {
curFrameNum ++;
} else {
curFrameNum = 0;
}
loadFrame();
}
// ----<prev slide>---- \
this.prevSlideBtn.onRelease = function() {
if (curFrameNum == 0) {
curFrameNum = Number(slideInfoLV.totalFrames) - 1;
} else {
curFrameNum --;
}
loadFrame();
}[/CODE]
Is there some attribute I should be referencing for urlLV to make this work? Or am I missing something else? Thanks in advance for any advice.
[MX04] Unable To Get LoadVars To Use Array Reference To Loaded Variable
Hi,
I would like to display some text that I have loaded into a movie through the “”LoadVars” object. I am able to do this if I “hardwire” the name of the variable to be picked up on in the loaded .txt file, but not if I use a reference to the variable by looping through an array holding the variable names used in all the files to be loaded in.
So in other words this will work:
Code:
_root.past_txt.text = _root.varLoader_array[0].past;
But this wont:
Code:
variableName_array=["past", "present", "future"];
_root.past_txt.text = _root.varLoader_array[0].variableName_array[0];
I think the problem might be that Flash sees the “variableName_array[0]” part as a string & not a variable, I really don’t know, but I would be grateful if anyone can help me out on this.
Many thanks.
Search Text
Hi
I've to make a flash file to search in 7000 phrase and return a value.
for example if the phrase number 150 is (the cat ate the mouse) and the user type cat as a search criteria the engine should return (150)
and if the search criteria is found in several phrases the engine should return the numbers of them all.
Any helping ideas
PS : I didn't start yet so I can build it any way.
A Way To Search For Text Across MCs?
I've got a big movie with actionscript across lots and lots of movieclips. is there a way to search the actionscript in all of them for a certain string? an extention, plugin, etc.?
for example, i'm trying to reduce the file size and remove a MC that is attached to other MCs via attachMovie. i need to find all of the places where this MC's linkage Id is called to make sure that i get them all.
i've found workaround, by placing a script inside of the offending MC that traces "hello!" whenever it's attached, but this is slow and cumbersom.
any tips?
thanks!
Search And Keep What I Need From A Text,,,,
hey. I need to make a script that can make a search for me.
let's say i have this following text:
he said: "i don't know why this script doesn't work"
what i need to do is to get what is between the quotation marks.
what i thought to do is to first find -he said: "- then keep only what is following which means -i don't know why this script doesn't work"- then look up for the second quotation mark and only to keep what was before. and to repeat this search through all the text.
thanks in advance. any help will be appreciate.
Perform Text Search
Hi,
I'm trying to search an Access DB by name from an user inputed text box in Flash. I can get it to work with numbers, but not text. One of two lines in the ASP is either wrong or I don't have some option selected in Flash which I need to check. The possbile ASP lines are
strsearch=Replace(request("begname"), "'", "''")
which should grab in the user input from the input text box called begname
OR
strsql = "SELECT * FROM tblGuestBook WHERE fldname='2'"
this line works, but if I replace the 2 with strsearch it doesn't work?
Suggestions?
Text Search Problem
ok i have teh following code:
Code:
// code on timeline
texttemp = textshow;
finded = 0;
stop();
//code on submit button
on (release, keyPress "<Enter>") {
sel = "U";
index1 = -1;
oldindex = 0;
finded = -1;
newstring = "";
s = new String(texttemp);
do {
++index1;
index1 = s.indexOf(textfind, index1);
if (index1 != -1) {
newstring += s.substring(oldindex, index1)+"<"+sel+">"+textfind+"</"+sel+">";
} else {
newstring += s.substring(oldindex);
}
oldindex = index1+textfind.length;
++finded;
} while (index1 != -1);
textshow = newstring;
where,
the input text field is - textfind
the text field that displays no of results found - finded
ok, now. two things.
1) a problem arises because you can search for " " (space) and when you do this it messes up the code. also when you search for a common letter such as 'e'. - how can i fix this?
2) the code is case sensitive- whereas i want it to be case-insensitive. Can this be done?
thanks in advance.
Search A String To See If It Contains Certain Text?
Hi there,
Im currently working with droptargets, and i get the folloing syntax back as a string ...
"_level8/alllines/redline4/dropzone4"
Can I search this string and see if it contains "dropzone4" as thats all I am looking for?
Or maybe strip the first lot of characters so I am left with the last 9??? as the formatting is standard number of chars.
Thanks for any help in advance,
How To Search Text From Inside Swf's
Does anyone know how could I create a searchable site that uses swf files?
I was wondering if using XML or TXT files will be my only answer. Any examples out there?
Thanks
Dynamic Text Search
O.k here's what I have. 3 ini files containing info
(server logs) to check the log for a user i need
to search through the ini file for the feild referance.
But there are a number of records matching the name, so i need
to keep pressing search until the final instance of that record
is displayed (this is the most up to date information).
What i need is flash to do the search on the feild referance
and only display the data for the final record for example.
Tina 1
Tina 3
Tina 5 "a search on tina would display this information"
Bob 1
Bob 27
Bob 35 "a search on Bob would display this information"
please help i would love to get this to work. I know flash
but not about external text files or how to search through
them. Any help would be fantastic.
Thanks, Luke
Text Search And Display
O.k here's what I have. 3 ini files containing info
(server logs) to check the log for a user i need
to search through the ini file for the feild referance.
But there are a number of records matching the name, so i need
to keep pressing search until the final instance of that record
is displayed (this is the most up to date information).
What i need is flash to do the search on the feild referance
and only display the data for the final record for example.
Tina 1
Tina 3
Tina 5 "a search on tina would display this information"
Bob 1
Bob 27
Bob 35 "a search on Bob would display this information"
please help i would love to get this to work. I know flash
but not about external text files or how to search through
them. Any help would be fantastic.
Thanks, Luke
Search & Text Update
Hello all, I'm a student learning web design, and I have a project idea but I'm really bad at programming and I'm learning these programs for the first time. I wanted to do a Search feature that allowed people to come up with classified ads based on the search criteria (drop-down search criteria), but also be able to upload their own ad with some kind of text update where they type in what they want as a description and then hit a confirm button and it is displayed in sequence with the other ads. Or maybe have some fields for predetermined information, and they fill in the fields and then hit an overall confirmation and they all get displayed in the ad?
Some classmates said that Flash might be a good option so I figured I would find out if A) there were any tutorials around based on what I would like to do. B) If anyone had any advice on how to do it in the most simple manner, or how to do it at all. I'm trying to get this together asap because of the project deadline.
I checked the tutorials area of this website, but the problem is I don't know what exactly the terms are for what I want to do, so I wound up searching through a bunch of stuff that wasn't really relevant.
Sorry if I haven't been to descriptive, or if I'm in the wrong forum tree. Thanks in advance to anyone who can help.
Suer
Text And Search Engines
ok i have a temporary site up and running for my business . i have noticed that because i have design the site in flash the search engine Spiders dont pick it up.
I have registered the web address and if you type in the business name the website address comes up - but what about if people don't know the name and are searching for the services.
Is there any way of making the text detactable to the search engines spiders?
I've a feeling htis is a dunb question but i am preying i don't have to use dreamweaver - cause that will mean a whole new lot of learning.
Search A Text File
I have a flash movie and i wan to know it is possible to open a text file inside the movie and search it the text file have information from let say a bunch of stores and i want to be able from flash make some sort of a dynamic index of the stores numbers so if you press " Store 1" it search in the text file for store 1 and it goes to where store 1 is and you can see the info. it is possible ?
dont know if i make myself clear!
[F8] Can I Search Inside Another .swf Text?
Hi there..
I know I can load an external swf inside my main movie. But, can I search inside? (I remember reading something about "after it loads, all objects are available to actionscript).
Thank you!!
Search And Replace XML Text
ok - so I am loading XML and then trying to search and replace some of the text: see below for code (this is after all the xml load stuff....). It is not effecting the xml after loading?!?!?!? please help.
function loadTxt(success:Boolean):Void {
if (success) {
var allXML:XMLNode = txt.firstChild;
txtCSS = new TextField.StyleSheet();
cssURL = "css/style.css";
txtCSS.load(cssURL);
txtCSS.onLoad = function(success) {
if (success) {
scroller.txt.t.styleSheet = txtCSS;scroller.txt.t.autoSize = "left";
scroller.txt.t.html = true;
scroller.txt.t.htmlText = allXML.childNodes[0].firstChild.nodeValue;
}
};
searchAndReplace(scroller.txt.t.htmlText, "1", "2");
} else {
trace("XML NOT LOADED");
}
}
function searchAndReplace(holder, searchfor, replacement) {
temparray = holder.split(searchfor);
holder = temparray.join(replacement);
return (holder);
}
Search Movie For Text
Hi....this is my first post on this forum...I was wondering if anyone knows of a way or a good tutorial resource that I could use to search for text within a flash movie....not a text box, but a movie....something like this:
HTML Code:
if (_root.myMovieInstance.text.indexOf("myKeyWord") != undefined) {
trace ("Found the word");
} else {
trace ("No word found");
}
that actually works...again, the text is not and can not be in a text box..thank you in advance.
Search In Text Field
I want a search in dynamic text field. I find this code of Jesse, but i don't know how to make it work. Any helps? If the textField has the searchWord, the text is highligh in red, else the "not found" text appear in the search result.
Quote:
In the code below the
(which is the standard newline delimeter for Flash) spearates one paragraph from another:
ActionScript Code:
searchWord = "bleh";
longText = "Paragraph one is blah blah blah
Paragraph two is bleh bleh bleh
Paragraph three is blah bleh blorg";
longAr = longText.split("
");
resultsAr = new Array();
for (var j = 0; j<longAr.length; j++) {
if (longAr[j].indexOf(searchWord) != -1) {
resultsAr.push(longAr[j]);
}
}
This breaks a given string down into an array, then checks each array entry for the search word. Those entries which have the search word (not it's case sensitive) are added to the results array.
Full Text Search Within A .swf ?
Anyone know if this is possible? FlashPaper 2 allows full text searching now (but only on certain docs) Obviouslly it won't be able to search through bitmapped or jpg pics, but a text pdf thats converted to .swf COULD in theory be searched. There is also a program called Flashseek that apparently does this too but i havn't gotten it yet. So I was wondering if anyone has done anything like this.
Thanks
McM
|