dcsimg
A Flash Developer Resource Site

Results 1 to 16 of 16

Thread: Calendar

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    109

    Calendar

    I was wondering if anyone knew anything about the Spark events calendar.
    I am trying to create one myself and can't figure out how they got it to highlight the dates that have events. I have searched there code and tried my own things but no luck. So here I am.
    Anyone know what function I need to call or what MC i need to attach to show a date with an event.

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,145
    post the link to what you're talking about

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Posts
    109
    I just don't know how to make it show a highlighted date like the ones here.

    Spak events calendar

  4. #4

  5. #5
    Senior Member
    Join Date
    Apr 2001
    Posts
    109

    Thank you

    But I have that already, I am not very good at actionscripting yet, I was hoping that you could explain that alittle better. There are alot of things here that I don't understand.

  6. #6
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    I just hope you're at least a good intermediate actionscripter This is not basic scripting and i would just suggest you forget all about it if you're in the beginner stage. When trying to understand how an application works a good tool is the debugger. You can see "live" the variables values change. You could, that way, at least trace the variables involved in any change of state.
    gparis

  7. #7
    Senior Member
    Join Date
    Apr 2001
    Posts
    109

    Ok

    I think I am intermediate. I have found the place that loads the array. But I still don't get how it shows the highlighted dates. Are you familure with that calendar?
    Anyway I was wondering , Have you gone to school for this? I looked at our community collage here and didn't see any classes for Flash, jsut basic stuff for webdesign. I try to understand alot by using the refrence guides and books but i need to ask PPL to get a full understanding.

    Here is my calendar for a game that I play Descent 3:
    Descent 3 calendar

    The problem with this is that I have to edit the FLA to add a button to the calendar when we scheduale a new game. This uses PHP/SQL. I have got the component calendar to use this also, but the spark one has to many things that I don't need, I was just tryin to see how it highlights the dates that have events. I see that it loads an array but man that whole (once,every other thursday, twice on sunday) shiz is confusing.
    Thanks for your reply I hope to learn more as this is adicting.

    You obviously have alot of experience. I like your site and all the stuff in it. Very smooth. I am going to check out more schools in my area for actionsipting tommorow.
    Last edited by Andrue; 05-05-2003 at 01:35 AM.

  8. #8
    Junior Member
    Join Date
    Aug 2000
    Location
    Canberra, Australia
    Posts
    5
    Andrue,

    I think your best bet will be to reskin the Spark version of the calendar and tailor it to what you want it to do.

    The examples I've put on the site include data loaded from an external source which could be easily changed to a php/mysql solution.

    The actually recurring forumla (the 3rd Thursday of each month type thing!) isn't very big and the component itself is under 10k.

    Hope that helps,

  9. #9
    Junior Member
    Join Date
    Apr 2000
    Posts
    17

    Attempting to have multiple event colors

    I have modified the XML that feeds the calendar to allow for Sports team to denote whether the game is home or away... take a look:

    <events startDate="2000-01-06" endDate="2004-12-03">
    <event title="The Dragons" eventTime="7:00 PM" venue="a" url="" description="" startDate="2004-04-06" endDate="2004-04-06" allDay="1" eventType="once" />
    </events>


    I have added the new XML attributes to the calendar_array like so:

    calendar_array.push({title:d.title,description:d.d escription,startDate:d.startDate.parseDate(),endDa te:d.endDate.parseDate(),allDay:Boolean(d.allDay), eventType:d.eventType,venue:d.venue,eventTime:d.ev entTime,pattern:qNodes[q].firstChild});

    I am trying to use the "venue" key to do an if else statement in the Date Box Movie clip's actionscript like so (this code is from line 27 of the Date Box clip):

    SparkEventsCalendarDateBoxClass.prototype.$addEven t = function (eventData) {
    this.eventData_array.push(eventData);
    if (this.eventsData[venue] == "h") {
    this.bg_mc.gotoAndStop("active");
    } else {
    this.bg_mc.gotoAndStop("away");
    }
    this.useHandCursor = true;
    // capture when date box is pressed and display its event(s)
    this.onRollOver = function () {
    var base = this._parent._parent;
    if (base.enabled) base.onDisplayEvent(this.$getEvents(), this.date);
    }
    }

    I can't seem to get it to work as expected... I have added a new keyframe to the Date Box Background clip named "away" where the box is differently colored...

    Whodini, or anyone else familiar with the Spark calendar, how can I control that Date Box movieclip to create different colors?

  10. #10
    Junior Member
    Join Date
    Apr 2000
    Posts
    17

    Eureka!

    I have successfully added the ability to colorize the dates in different fashions based on info fed to it in the XML document...

    Follow my instructions listed in my previous post, but modify this code:

    SparkEventsCalendarDateBoxClass.prototype.$addEven t = function (eventData) {
    this.eventData_array.push(eventData);
    if (this.eventsData[venue] == "h") {
    this.bg_mc.gotoAndStop("active");
    } else {
    this.bg_mc.gotoAndStop("away");
    }
    this.useHandCursor = true;
    // capture when date box is pressed and display its event(s)
    this.onRollOver = function () {
    var base = this._parent._parent;
    if (base.enabled) base.onDisplayEvent(this.$getEvents(), this.date);
    }
    }


    to this:

    SparkEventsCalendarDateBoxClass.prototype.$addEven t = function (eventData) {
    this.eventData_array.push(eventData);
    trace(this.eventData_array[0].venue);
    if (this.eventData_array[0].venue == "h") {
    this.bg_mc.gotoAndStop("active");
    } else {
    this.bg_mc.gotoAndStop("away");
    }
    this.useHandCursor = true;
    // capture when date box is pressed and display its event(s)
    this.onRollOver = function () {
    var base = this._parent._parent;
    if (base.enabled) base.onDisplayEvent(this.$getEvents(), this.date);
    }
    }


    In my example, the attribute "venue" was added to the XML in order to give the calendar to color the dates based on whether the game was at home or not... you could modify this to signify many different things, though...

    Calendars color coded for more than one individual or group.
    Calendars color coded to siginfiy availability of resources or conference rooms.
    Calendars color coded to denote multiple task types

    You could add as many different values to that attribute as you want, simply add more keyframes to the Date Box Background clip as needed and modify the if/else loop to reflect the added values.

  11. #11
    Junior Member
    Join Date
    Apr 2000
    Posts
    17

    Shared object support

    I have successfully added shared object support for the Spark OS calendar as well...

    to do so, modify the code at line 291 in the Day box clip... (i set a varaiable on the main timeline if an active connection to web exists named "loadLiveData".)

    SparkEventsCalendarClass.prototype.setDataProvider = function (data_array) {
    if (_root.loadLiveData == true) {
    this.data_array = data_array;
    calendarSO = sharedObject.getLocal("Calendar");
    calendarSO.data.events = this.data_array;
    calendarSO.flush(10000);
    } else {
    calendarSO = sharedObject.getLocal("Calendar");
    this.data_array = calendarSO.data.events;
    }
    this.$drawCalendar();
    }

  12. #12
    Senior Member
    Join Date
    Feb 2001
    Posts
    268
    hi rinse.

    i've been searching thru this forum for info about the DateChooser component and I was wondering if you wouldn't mind answering my question as it looks like you've done some exploring in this area.

    first off, i'm using the version 2 component structure and i'm trying to extend the functionality of the DateChooser component so it will highlight days depending on whether there is an event on it. (i pass this info via an xml doc).

    what i'm really trying to do is create a syllabus. if there's an assignment due on the 15th or the 9th or the 3rd or whatever, then that day will be highlighted.

    from what i understand, you could do this with the v1 DateChooser component but you cannot with v2. there is a showToday() method which highlights the current day and it also accepts ranges of days for blackout, etc...

    my question is...if i can pass the component a specific day or a range of days then wouldn't i be able to pass a series of non-continuous days that would then activate its highlight property?

    am i right in thinking that i can go into the DateChooser.as file (and the associated CalendarLayout.as file) and put in a few lines of code to extend its functionality to do this?

    thanks. fumeng.

  13. #13
    Junior Member
    Join Date
    Nov 2006
    Posts
    2

    Monday shouldn't be first.

    Hey Rinse... teriffic moding! I was curious if anyone has been able to get Sunday to be the first day in this calendar... it is very odd that Monday is... let me know... i've been combing the code and I can't get anything.

  14. #14
    Junior Member
    Join Date
    Nov 2006
    Posts
    2

    to get the calendar to work

    Hey guys hopefully I can help all of you that need to get this working... the code works pretty well on its own.. when it recognizes an event it highlites it for you... and with some witty moding like rinse above explains, you can add as many different color variables as you need. That took some brain stretching for me but it was doable for a new/lower intermediate like me.

    To get the thing working I went to the main site:

    http://www.sparkos.com/downloads/com...ventscalendar/

    and instead of downloading the Zip at the top, I went to the bottom and got used the source code... download the ZIP next to "loading data via XML" This lets you use an xml document to load your content, but they have already done the linking for you.

    Open the fla, and copy the componet to your own fla. Notice, you'll have to copy action script from frames containing the component as well... Manipulate as needed. Also there comes with that an xml document named SparkEventsCalendar_loadXml Open this xml file and see the layout for inserting dates... see that all the dates are from a few years ago so of course you can't see the dates when you preview the calendar.

    If you want to rename the xml, do so, then in the actionscript that is contained within the frame, go to line 262 and change the script to reflect the new name of the xml document so it loads it.

    If anyone can figure out how to make Sunday first instead of monday... that would be terrific! Let me know!

    That should get you started I hope!
    Last edited by wwjdtoyou; 11-02-2006 at 02:54 AM.

  15. #15
    Senior Member
    Join Date
    Jul 2006
    Posts
    122
    where would i add the coding for the new XML attributes to calendar_array as i can not find aclendar array

  16. #16
    Senior Member
    Join Date
    Jul 2006
    Posts
    122
    also is there anyways in which you can only colour half days depends on the time of the event

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center