Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting 2 variables together to make 1 variable...How? 3

Status
Not open for further replies.

TulsaJeff

Programmer
Jan 29, 2001
870
US
I am wanting to set up a calendar on my website and in doing so am using buttons to set the month variable as well as the year variable. I want these two to combine and make another variable which pulls that month/year info from a .txt file.

For example: I press the January button which sets calmonth to variable "jan"

I also press the 2002 button which sets calyear variable to "2002"

I have a text file in my root directory which contains info for variables "jan2001", "jan2002", "feb2001", "feb2002", etc. each with its own information.

What is the correct actionscript to accomplish this?

Ya' Gotta Love It!
sleepyangelsBW.jpg
 
Glad to have been of some help!
I'm still learning too!

Regards,
wink4.gif
ldnewbie
 
Old... another question...

I could have swore I had this thing automatically showing the info for this month and this year upon entering the calendar frame with the following script:

on (press) {
gotoAndStop ("calendar-fr");
_root.calendar_in.calchoose = "choose a month to display";
_root.calendar_in.calyear = _root.date_in.b;
_root.calendar_in.calmonth = _root.date_in.monthname;
selection = calMonth+calYear;
_root.calendar_in.text = _root.calendar_in[selection];
}

note: variable "b" is todays date

... I even showed it to my wife now it will not display until I hit a month button with the following script in it:

on (press) {
text = "";
calMonth = "December";
selection = calMonth+calYear;
text = _root.calendar_in[selection];
}

I have a

loadVariables ("calendar.txt", "_root.calendar_in");

on the calendar button which takes you to the calendar and also on the first frame of the actual calendar mc.

So I cannot figure out why it stopped showing automatically but does someone know how to make that happen?

It pulls this month and this year and puts them into the calmonth and calyear just fine but the text box which holds the calendar.txt info will be empty until I hit the month button.
Ya' Gotta Love It!
sleepyangelsBW.jpg
 
A bit hard to follow you... And might need to look at your .fla!
But, one quick thought that comes to mind...
In your first script:
on (press) {
gotoAndStop ("calendar-fr");
_root.calendar_in.calchoose = "choose a month to display";
_root.calendar_in.calyear = _root.date_in.b;
_root.calendar_in.calmonth = _root.date_in.monthname;
selection = calMonth+calYear;
_root.calendar_in.text = _root.calendar_in[selection];
}
... Think it goes to calendar-fr right off and doesn't mind about the rest of the script. Don't think changing the order of the script would change anything either.
Have you tried putting the rest of the script on the labeled frame calendar-fr?

Otherwise, I'll really need to have a look at the .fla so I can understand it better.
You can allways e-mail it to me.

Regards,
wink4.gif
ldnewbie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top