-
-
Senior Member
Im not realy sure how you wante dthe text file name to be formatted..
day, month year? month, day, year? any kind of seperators? (I put dashes in mine so you can tell the different values.)
Code:
//Get DATE:
myDate = new Date();
date = myDate.getDate();
month =["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
year = myDate.getFullYear();
file = month[myDate.getMonth()]+"-"+date+"-"+year+".txt";
trace(file);
// Load text file of same name as DATE:
myVars = new LoadVars();
myVars.onLoad = function (success) {
if (success) {
_root.textBox.html = true;
_root.textBox.htmlText = (myVars.info); //info = variable in text file
} else {
_root.textBox.htmlText = "Error loading text file";
}
}
myVars.load(file);
the ONLY thing Im not sure on is how to pull the OLD data back if not current data is there.. (maybe nothing..and the text field just wont update at all)
this was fun for me..LOL
thanks
Last edited by whispers; 01-03-2006 at 06:33 PM.
-
Thats so nice of you thanks!
Ill check it out tommorrow at work and see how its goes! Thanks so much for putting your time in for no real benefit to yourself! Class A Person
-
Senior Member
no problem..lik I said I had fun..my first time with arrays really.
still not sure how this part works...
month[myDate.getMonth()]
I man I understand the individual parts of it.. just not the variableName[var.function] part
I think I'll ask about it.. LOL
update: nevermind..I tink that is the index [] part of it (Im foolish) LOL
Last edited by whispers; 01-03-2006 at 06:40 PM.
-
Originally Posted by whispers
no problem..lik I said I had fun..my first time with arrays really.
still not sure how this part works...
month[myDate.getMonth()]
update: nevermind..I tink that is the index [] part of it (Im foolish) LOL
Hmm, hello again! And many thanks again! I have a dynamic text box where the content of the text has to go into, but at the moment it just says
_level0.instance3.textBox xxxxxxxxxxxx CORRECTION, ignore, please read below!
Any ideas? Do i need to change the name of the dynamic box, at the moment i called it textBox? Also, is there a way to change the date formatting so its shown the english way ( 4-1-2006.txt ) no big deal if i can't!
THANKS!!!
Last edited by domdino; 01-04-2006 at 07:40 AM.
-
oh and finally... heres the FLA file currently that will probably make life easier so you can see what i'm doing, or not doing as the case may be!
http://www.petendom.co.uk/portfolio/EADT.fla
-
Here i am again, being a pest
Its not putting _level0.instance3.textBox in the dynamic text box anymore after i whacked it down to publish for flash 5... i had to remove the instance name cos it wasn't supported, so i guess it has something to do with that!
So... I need to figuire out how to print this text to that dynamic text box!
Reuploaded the FLA: http://www.petendom.co.uk/portfolio/EADT2.fla
Anyone online who can help out would be top notch!
-
me again... haha... another thing unrelated to current problems, wondering if anyone knows if its possible to antialias text coming from an external source/dynamic text?
Been trying to figuire out how the code works more now, and it seems to load the file but the section :
// Load text file of same name as DATE:
myVars = new LoadVars();
myVars.onLoad = function (success) {
if (success) {
_root.textBox.html = true;
_root.textBox.htmlText = (myVars.info); //info = variable in text file
} else {
_root.textBox.htmlText = "Error loading text file";
}
}
myVars.load(file);
Anyone know whats going on here? I'm trying to print it to a dynamic text box, and the text files do start with textBox=....any help? God i'm dumb. AKKK
Thanks again and again againg.!!!
Last edited by domdino; 01-04-2006 at 07:36 AM.
-
Senior Member
are you using FLASH 5?
if so..none of this will work..you shoudl have stated that in the beginning.
ALWAYS state your version of FLASh that you are using.. "AND" post code/.FLA when starting an initial post.
or it just wastes EVERYONES time.
also..if you LOOK at the code..and read the comments after the line..you will see that the text files has to have &info= NOT &textBox=
_root.textBox.htmlText = (myVars.info); //info = variable in text file
but you said you were using FLASH 5....didnt you? so this wont work for you anyways.
-
hi again!
Im using flash 8 but i'm publishing to flash 5, otherwise it might have compatability issues. Ill take another look at the text file thanks
-
Senior Member
you need to at LEAST publish to flash 6 (MX) and I doubt you'll have any compatibility issues there..maybe with flashplayer 8...9but even then it would say you need the newest plug-in)
anyways... change the text file to be info= and publilsh/save as AT LEAST FLASH PLAYER 6 (MX)
once we get that far..I'll show you how to chnage the file NOT loaded part to do whatever it is you want to accomplish!
good luck Im on my way to work..so I wont respond for about an hour or so.
-
if i put in
_root.gotoAndStop("a frame number");
instead of _root.textBox.htmlText = "Error loading text file";
will that throw the flash to the right place if there is no text file present?
I've put info= at the start of the text document now, still doesn't seem to be showing up... i named the text file 1-4-2006.txt and just put this inside it: info= TEST ETSTESRPOTMSPLKREMt
Also tried it with &info= at the start but didn't seem to make any difference
Sorry for being a dumby but i really do suck at coding anything :/
And thanks again for taking time to help me out!
-
Senior Member
are still trying to publish to FLASH 5? Im telling you that is yoru problem..that code doesnt exsist in FLASH 5
You are ALSO trying to talk/target a textField by a NAME!!! which didnt exsist in FLASH 5 either.
-
I'm publishing to flash 7 now! ahhh... i really am dumb i'm so sorry...
i didn't call the text box anything i just made the var= textBox...
SORRY!
Works now, kinda, only problem is the size of the font is huge but should be able to figuire that out somehow!
THANKJYOU!!!
-
-
Senior Member
?? did you post a question??
-
hiya, my question was just that the fonts weren't working properly...
But i've discovered you have to embed them to get them to work if its dynamic text! Thanks for popping in anyway!
Only other thing i want to be able to do now is simply make the file not appear if the user doesn't have flash, as opposed to telling them to install it, and i need to do it without editing the header of the HTML, just where the flash itself goes...
Thanks again so much for all your help!
-
Senior Member
you can use some detection script/code in your HTML page that will detect this for you... and show an image (or whatever) insteadof the flash movie if the plyer is not deteteced.
-
hello again...
bit of a weird problem going on...
the file is now at http://www.eadt.co.uk/content/eadt/default/EADT3.swf
but sometimes the text doesn't appear, and it seems to be totally random whether or not it decides to appear.... this is the page it appears on: http://www.eadt.co.uk/content/eadt/d...efault_pp.aspx
sometimes it loads the text file, other times it just ignores it and doesn't bother!? If it wasn't loading the txt file and showing the alternate message that would make sense but it just comes up blank..... hmmmmf. Confused!
Dom
-
is there a way to make it force load the txt file, or if for some reason it thinks the text file is blank revert to the other frame display or something? its really odd...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|