Sending Data through functions

3 posts

Flag Post

Is there a way to send data through a function on a different frame. I am making a calendar for a web page and I am taking data from an object and I want to send it to a different frame that has only 1 days worth of data on it. My frame 1 has an entire calendar and my frame 2 has just one day. so i want to send the data when i click on the day to send from frame 1 to a function in frame 2. This is what I have on frame 1:


stop();
var my_day:Object = new Object();

first_btn.onRelease = function()
{
my_day.date = “Feb. 1st, 2008”;
my_day.title_event = “First Day of February”;
my_day.info = “This is the first day of Feb.”;
sendData(my_day);
gotoAndStop(6);
}

And i want it to send my_day, the object to frame 2 which has this:


function sendData(my_day:Object)
{
//Sets dynamic text to the my_day object’s Strings
titleTxt = my_day.title_event;
dateTxt = my_day.date;
infoTxt = my_day.info;
}

Any help would be great. Thanks in advanced

 
Flag Post

All you would need to do to get that to work is put your sendData function on frame 1.

Variables aren’t restricted to certain frames of a MovieClip, so if you set titleText etc on frame 1, they will still have their values when you go to frame 2, and their associated textfields should still display those values properly.

 
Flag Post

ok thanks alot i figured it out earlier, but now i get why that works.