Calander component

Does anyone know how to use this darn thing?
I cannot find any tutorials on how to use it.

Maybe someone can write a smal tut?

All I want to be able to do is click on a date, and have it display something…like an event that is coming up, and people can find out whats coming up.

Anyone have any ideas where I could look?

I am a newbie…

Thanks for any response.

Fleming

where’s this calendar?

:love: ~Seretha

Yup… You should supply more information if you say THIS DARN THING… Why do you need to use THAT DARN THING, by the way??? :rambo:

Go to the FlashComponents and search for a calendar if you do not need specific one… Maybe that will be abit easier for you than using Flash’s own calnedar component…

Sorry my fault…

I am using the one from Flash. UI Component 3
Advanced calendar.

I went to flashcomponents, and I downloaded the SPARK claender…but once again no documentation, so I don’t know how to use it. And I can’t find one made from Coldfusion, so I figured I have a premade calendar already, hy not try and use it.

I can’t show you it, cause it doesn’t do anything.
It sits on my screen, I can’t even figure out how to make the dates “clickable”

I have read alot about these components not having good documentation, so I thought someone out there might have written one.

Did I mention…REAL newbie?!

well i am sure there is a better way to do it then I am about to propose but im also sure they’ll post it beneath to correct any problems my solution has…

I personnaly have never made a calendar in flash but I would have just made the calendar will buttons as the dates and so when the ‘dates’ were clicked on it loaded a movie explaining the days schedule or whatever. Now i’ve never looked at the calendar in flash so if I’m way off i’m sorry but I thought id at least give you my opinion.

:love: ~Seretha

Sorry… I don’t think I can help you… I ain’t got the UI set 3… :cyclops: By the way, did you check out the reference panel in Flash??? There’s gotta be some documents… =)

fleming: i got the sparks calendar working actually
u can go
http://slog.nisausdx.net/
click on the blog button and see the calendar working with a dynamic textfield

is that what u want it to do?

YUP that is EXACTLY what I want.

Too bad I wasn’t a nice guy, I would send you the component :slight_smile:

but I am not about to get into trouble around here!

How did you do that???

Tell all secrets please!!

thanks,

Fleming

Too bad I wasn’t a nice guy, I would send you the component
but I am not about to get into trouble around here!
Ho… You wouldn’t do that and I wouldn’t either just for $100 piece… I’ll think about it again if that is $100000 software… :cowboy:

Besides that, there are several available out there… Having a higher version doesn’t always mean that the product is best…

Oh… I almost forgot… =)
You might want to see this thread… Madokan is a great guy who might give you a hand… I know he is abit busy guy too… =)

Just take a look and see if this will do the job for you too… I don’t see why this shouldn’t when Sparks does the job… :wink:

hmmz their main site got 3 ways to doing this
i did the worst way actually thru AS haha
ok this is how u do it…

ok first go here
http://www.sparkos.com/downloads/components/eventscalendar/source/SparkEventsCalendar_manualData.html

  1. get the AS for compiling the information for the calendar
    put the entire thing in the frame u want the calendar to appear

  2. the calendar mc call it calendar_mc in the instance name

  3. create a dynamic text field call it events_txt in the instance name. Remember to render text as html and give it a scrollbar if u need

  4. look at the AS in step 1
    part of the code rite at the bottom is something like this


event1 = new Object();
event1.startDate = new Date(2003,1,12);
event1.endDate = new Date(2003,1,12);
event1.eventType = "once";
event1.title = "Spark Event Calendar Released";
event1.description = "An example event which occurs once."
event1.allDay = true;

myEvents = new Array(event1, event2, event3, event4); // join all the event objects into an array

i am just going to put one event here cos too long…
everytime u enter a new event there

event(x) = new object() blah blah blah…
check out the 4 sample events they put there, the diff is in the eventtype, i suggest u look at the test movie and see the title and description etc. Since the text is rendered from html, u can put

 <br> <b> <i>

etc codes in the description

And remember lets say u enter the next event is event5

myEvents = new Array(event1, event2, event3, event4,event5);
remember to add the event5 inside this array as well or it wont compile

[edit]
a final note… i feel this is really stupid and suggest u look at the site for xml loading which is better
but then i am waiting for another xml calendar which is even more efficient
http://www.kirupaforum.com/showthread.php?s=&threadid=16381
which cyanblue already mentioned
:slight_smile:

Does your calendar use PHP?
Does the SPak use it to?

I didn’t realize that if it did, cause I am not using PHP.
That sux then.

I would prefer to use the XML version, and I guess I will take what you suggested and see if I can create an XML version.

You have at leat given me a starting point.

Thanks,

Fleming

yah the other one will need php i believe…

sparks dun need php…
as for the xml i havent try it yet… hmmz… cant really help u
i have a look at it later

yo fleming
i figure out the xml way
this is the code to place in the frame u have ur calendar in


/*
	Spark Events Calendar XML Example:
	This is a simple example on how to use XML to populate the calendar
	with an XML data file.
	The XML file could be generated via PHP or CF (or similar) from
	a database or written by hand.
*/


// display event handler
// for simpilicty of this example, trace is used to show the event information
calendar_mc.onDisplayEvent = function (eventsData,dateObj) {
	var output_str;
	var c = events_txt;
                c.htmlText = "";
	for (var i=0; i<eventsData.length; i++) {
		output_str += "Date: " + dateObj + "
";
		output_str += "Start Date: " + eventsData*.startDate + "
";
		output_str += "End Date: " + eventsData*.endDate + "
";
		output_str += "Event Type: " + eventsData*.eventType + "
";
		output_str += "Title: " + eventsData*.title + "
";
		output_str += "Description: " + eventsData*.description + "
----
";
	}
	c.htmlText += output_str;
//	trace(output_str)
}

// select date handler
// for days with no events, could be used as a date selection tool
calendar_mc.onSelectDate = function (dateObj) {
	trace(dateObj);
}

// hide event handler
// since trace is used to show the event, no hide function is required
calendar_mc.onHideEvent = function () {}

// parse date prototype
// takes a string formatted as: "yyyy-mm-dd HH:mm:ss" and converts it to a date object
String.prototype.parseDate = function () {
	var d = this.split(" ")[0].split("-");
	var t = this.split(" ")[1].split(":");
	return new Date(d[0],d[1]-1,d[2],t[0],t[1],t[2]);
}

// hide the calendar while we populate it
calendar_mc._visible = false;
getEvents = new XML();
getEvents.ignoreWhite = true;
// when the data has been loaded
getEvents.onLoad = function () {
	// calendar_array will hold the calendar data that has been loaded
	var calendar_array = new Array();
	var minStartDate = this.firstChild.attributes.startDate.parseDate();
	var maxEndDate = this.firstChild.attributes.endDate.parseDate();
	// minStartDate and maxEndDate are used to set the displayRange
	calendar_mc.setDisplayRange({begin:minStartDate,end:maxEndDate});
	// loop over the event nodes in the xml
	// and stores the record as an object inside calendar_array
	var qNodes = this.firstChild.childNodes;
	for (var q=0; q<qNodes.length; q++) {
		var d = qNodes[q].attributes;
		calendar_array.push({title:d.title,description:d.description,startDate:d.startDate.parseDate(),endDate:d.endDate.parseDate(),allDay:Boolean(d.allDay),eventType:d.eventType,pattern:qNodes[q].firstChild});
	}
	// pass the data array to the calendar
	calendar_mc.setDataProvider(calendar_array);
	// show the calendar now it is ready
	calendar_mc._visible = true;
}
// load the SparkEventsCalendar_example2.txt into the XML object
getEvents.load("SparkEventsCalendar_loadXml.xml");

  1. the last line is obviously the xml file
  2. have a dynamic text field called events_txt, render as html, multiline and remember to put a scrollbar
    basically the parsing of information from the xml is done here
    calendar_mc.onDisplayEvent

the outputstr is the output string which it will display altogether
use the attached xml file to test run it…(delete the doc extensions)
it is working for me
:slight_smile:

[edited]
this is the code that i changed to make it look more like a blog
for ur reference to how to change the look on ur textfield


calendar_mc.onDisplayEvent = function (eventsData,dateObj) {
	var output_str;
	var c = events_txt;
    c.htmlText = "";
	for (var i=0; i<eventsData.length; i++) {
		output_str += "<font color='#283569'><b>" + dateObj + "</b></font><br>";
		output_str += "<font color='#000000'><b>" + eventsData*.title + "</b></font><br>";
		output_str += eventsData*.description + "<br><br>";
	}
	c.htmlText += output_str;
//	trace(output_str)
}

Thanks alot I really appreciate your help.

I will look into it…and post the results later on.

cheers!

Fleming

i not sure what u need it for… but if u try to represent a breakline in the descriptions, it dont seem to work… at least not for me.
Go try it out and see how, cos i change lots of the codes to suit my own needs…

cheers
:slight_smile:

Well basically the only thing I need it for is. I designed and maintain a website for a band…and I would like to have people be able to click on a date (upcoming shows) and have it display the time, place, cost…

Make sense?

I will have to fiddle with it I am sure.
I am a newbie in flash, so it will take some patience!

ok basically i am assuming

  1. u do need the breaklines or else the information will be joined in one line?

in that case either
a) that is a way to represent breaklines from the xml file to the textfield
so simple just write everything in the description attribute and done!

b) there is no way that we know (i am a newbie too! hehe)
If you are really desperate, this is what u can do
add some more additional attributes to the event type

<event time = "1800" place = "down the street" cost="6 bucks" title="Test Event 1" description="once on 10 february" ... />

i have added time,place and cost attributes here
if you use this method then u need to do one more thing to the AS

go look for this line

calendar_array.push({title:d.title,description:d.description,startDate:d.startDate.parseDate(),…});

rite infront of the title put the 3 attributes in like this
time:d.time,place:d.place,cost:d.cost,
so that line now becomes

calendar_array.push({[COLOR=red]time:d.time,place:d.place,cost:d.cost,[/COLOR] title:d.title,description:d.description,startDate:d.startDate.parseDate(),…});

then to represent it in the text field u go back to edit the output_str

add a few lines of codes like this inside the for loop(you can format it urself)
output_str += eventsData*.time + "
";
output_str += eventsData*.place + "

";
output_str += eventsData*.cost + "

";

and u r done!
:slight_smile:
hope i manage to help u

Wow… this seems a bit harder then I thought!

**** it I hate when that happens! :slight_smile:

Well I am gonna have to start from scratch now…so I can get this right!

I do have another question though.

Where the “event display” will be shown ( EXAMPLE:Yours is to the right of the calender) I would like mine underneath it, I do not need alot of space.

My Question:

Is it put into a separate movie clip?

Sorry for asking alot of questions…

:frowning:
sorry fleming
there is a easy way to show line breaks with xml

i just found out myself
this is the code

<br>

descriptions = "down &lt;br&gt;the street"

will print

down
the street

for ya already… so there is no need to go thru what i told u
real sorry…

as for the one underneath it… i not sure what u mean by underneath

Thats okay…thanks for the post anyways!!

What I meant is having the calander ontop of the “displayed events” and NOT beside it like you have on your site.

I don’t want the calander to be overpowering… i just want it to be on the front page so everyone can check out the upcoming shows.

I guess I will have to try and pick apart the file…and see what happens.

I already feel a headache coming on!!
:slight_smile: