| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
way of the other
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
|
hi - i'm having a little trouble with this. i am trying to set a variable that will be used in a loadVariablesNum statement.
the code: onClipEvent (enterFrame) { noteMonth = _root.calendarHold.calendar.checkMonth; noteDay = _root.calendarHold.calendar.checkDay; yesterday = noteDay-1; yesterdayNoteName = noteMonth+" "+yesterday+" "+"Notes"; loadVariablesNum (noteMonth+"/"+"notes"+"/"+yesterday+".txt", 0); } the error: Error opening URL "file:///notes/-1.txt" <-- this here when i check the variable in a txt box, it comes up as it should (in this case '7') tah! |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Dec 2000
Posts: 72
|
Now I'm not an expert on flash but perhaps take out the "/" because unless the txt file is in the root directory it should not be there. either that, or give it an absoulute path like c:\notes\1.txt. I've also noticed that you have -1.txt is that the actual name of the file?
|
|
|
|
|
|
|
|
|
#3 |
|
way of the other
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
|
i'm using the "/" as a literal string to define the path to the .txt file.
the '-1.txt' is the problem i am having. the path to the .txt file should be : February/notes/7.txt as you can see, that is what i am trying to achieve with this statement: noteMonth+"/"+"notes"+"/"+yesterday+".txt" where: 'noteMonth" = February dir '"notes"' = notes dir 'yesterday' = noteDay (which, in this case, is 8) -1 '".txt"' = the file extention but thanks anyway. |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,612
|
No, the orriginal scrip is your problem.
None of your variable have any values, which is why you're not getting the right output. Either that or the paths to your variables are wrong. The fact that you get -1 means that 'noteDate' has no value no value is equivalent to 0) yesterday = noteDay-1; = 0 - 1 = -1. Also your month isn't comming out because it's no inserting February into the string. Test Mode your movie (Ctrl Enter in flash) then user Ctrl Alt V to view your variables. If they have values, then copy and paste the paths to them and use absolute paths fo safety. Finally, change the last line of code to: loadVariablesNum (noteMonth+"/notes/"+yesterday+".txt", 0); (That's just mroe efficient.) Cheers Jesse
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
|
|
#5 |
|
way of the other
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
|
thanks jesse - it's working, i guess, but i'm still getting the error:
Movie Clip: Target="_level0.notePadYesterday" Variable _level0.notePadYesterday.name = "notePadYesterday" Variable _level0.notePadYesterday.noteMonth = "February" Variable _level0.notePadYesterday.noteDay = 9 Variable _level0.notePadYesterday.yesterday = 8 Variable _level0.notePadYesterday.yesterdayNoteName = "February 8 Notes" Error opening URL "file:///notes/-1.txt" as you can see, yesterday does = 8 (today is the 9th), but the app is still looking for ///notes/-1.txt the clip loads with the correct info in the text box, i must have that coded somwhere else in the movie. |
|
|
|
|
|
#6 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,612
|
When all else fails use absolute paths:
loadVariablesNum (_level0.notePadYesterday:noteMonth+"/"+"notes"+"/"+_level0.notePadYesterday:yesterday+".txt", 0); See if that works. Cheers Jesse
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| setting variable - level communication | TheSheriff | ActionScript 1.0 (and below) | 2 | 06-06-2005 06:32 PM |
| urgent need help with setting loadvars variable | natronp | ActionScript 1.0 (and below) | 5 | 08-02-2004 05:18 PM |
| Setting variable text with a condition loop | myrn | Simple Stuff (Newbies) | 5 | 08-21-2003 06:12 PM |
| Setting and Concatenating Variable Values | jcolletti | ActionScript 1.0 (and below) | 1 | 10-10-2002 06:53 PM |
| Accessing and manipulating variables brought in by LoadVariablesNum() | gregorykai | Server-Side Scripting | 1 | 01-18-2002 11:57 PM |