Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-08-2001, 04:47 PM   #1
flyrod
way of the other
 
flyrod's Avatar
 
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
Default

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!
flyrod is offline   Reply With Quote
Old 02-08-2001, 05:57 PM   #2
jake88
Registered User
 
Join Date: Dec 2000
Posts: 72
Default

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?
jake88 is offline   Reply With Quote
Old 02-08-2001, 06:04 PM   #3
flyrod
way of the other
 
flyrod's Avatar
 
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
Default

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.
flyrod is offline   Reply With Quote
Old 02-09-2001, 03:14 AM   #4
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

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.
Jesse is offline   Reply With Quote
Old 02-09-2001, 02:45 PM   #5
flyrod
way of the other
 
flyrod's Avatar
 
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
Default

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.
flyrod is offline   Reply With Quote
Old 02-10-2001, 12:12 AM   #6
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

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.
Jesse is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

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


All times are GMT. The time now is 08:29 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.