dcsimg
A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 33

Thread: Calendar Component

  1. #1
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    Hello all,

    I want to use the calendar component on my site in the following way:

    When someone hover's over a date I want it to display whether or not this day has events.

    When someone click's on that date I want to display those events.

    Being a newbie to flash I don't understand how to edit this object.

    Can anyone please point me in the right direction, I can not find any documentation on that component?

    Thanks

  2. #2
    Senior Member
    Join Date
    Mar 2002
    Posts
    334

    Smile

    Ok,
    I just looked at it.. here is what i've got so far

    (by so far i mean.. in the past 5min. here is what i've come up with )

    Make a calendar called cal and a function in the first frame of the main time line.. like below

    Code:
    function fun()
    {
    	myItem = cal.getSelectedItem();
    	trace(myItem);
    }
    this is crude but maybe a start

  3. #3
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    thanks,

    I'm new to this actionscript stuff but i've programmed in C/C++ for a while now. what do recommend is the best way to learn this stuff?


  4. #4
    Senior Member
    Join Date
    Jul 2000
    Posts
    336
    Originally posted by ethomas
    thanks,

    I'm new to this actionscript stuff but i've programmed in C/C++ for a while now. what do recommend is the best way to learn this stuff?

    Refer back here often. I dont think there has ever been one question that I had that someone here couldnt answer.

    Also, jsut like everything else, books. I've got the Flash 4 Bible and the Flash 5 Bible, those are pretty good. Although i'd wait until some MX books are released.

    .fe.

  5. #5
    Senior Member
    Join Date
    Mar 2002
    Posts
    334
    hehe I dunno.
    I am learning as I go. I have been using flash since flash 3, but never really got deep into AS. I actually started learning Java and when I did that I started to see that code wasn't scary at all, but powerful and time saving. So I took my limited java knowledge and started working on AS. I got Flash 5 magic and that was really helpful, since it showed me how to do things in an example rather than abstract.

    Since you've done C/C++, AS shouldn't be too difficult for you. The only real advice I can give is use the docs that MM provides (just found out that you can get to the code refrence docs in the AS panel by clicking on the little thing that looks like a book (*yeah the dicionary icon.. i'm slow)

    And also every time one of these AS bad asses posts code.. read through it and see how they did what they did..

  6. #6
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    thanks final eternity,

    I also have the flash 5 bible, I guess I can start there with the actionscript basics until the MX version comes along.

    ..Flash is too addicting.. must get sleep...

  7. #7
    Senior Member
    Join Date
    Mar 2002
    Posts
    334
    Oh maybe I can give one more tip

    This is helping me a lot right now..

    I come to the forums (were-here and of course this one) and read all the questions and try my best to find the answer and help the other person. Even if I could care less about what i'm trying to figure out. Because you never know when you're going to need help with that same question ya know? And it's good detective work, and it gets you more farmiliar with what other things can do..
    best part is that you may have one answer and then some one comes along and gives another answer that was much easier.. and you learn a better way

    As far as you calendar..
    I'm still messing with it.. hehe

    These components are really cool.. just wish I had more examples to look at to see how to do things.

  8. #8
    Senior Member
    Join Date
    Mar 2002
    Posts
    334

  9. #9
    Senior Member
    Join Date
    Mar 2002
    Posts
    334
    So what I did was let you choose all dates except weekends..

    I guess you could modify this so that people can only click dates which have events... or something like that.

    Maybe i'll play with this tomorrow after (or at hehehe) work.

    My guess is that you could make an array of all the dates in the year
    as in

    Code:
    myArray = new Array();
    myArray[11] = "Event for Jan. 1st";
    then when the code gets the selected date have it load the array that corrosponds to the month + date number.. (ok did that make sense?? I think I should sleep now..)

    This probably isn't the most efficent way to do it.. but hell it's the best I can come up with right now..

    Flash MX is SO addictive. I was supposed to work on learning JSP this weekend.. but Flash MX came out friday and I haven't done any thing but MX all weekend..

  10. #10
    Junior Member
    Join Date
    Mar 2002
    Posts
    14

    cool

    good stuff, that seems like a good way to do it.

    I have finals all this week so after that I'll play with it some more myself and post here what I come up with. I think it's cool little component. I'm very excited to see what they come up with next. But I hope next time they include some documentation and examples.

    I was just being lazy, but I think it's worth my time to learn this stuff (action scripting)

  11. #11
    Retired Mod aversion's Avatar
    Join Date
    Jun 2000
    Location
    insomnia
    Posts
    7,917
    Originally posted by Squareball2
    Ok check this out

    http://mrbella.com/torrey/mxtest/calendar.swf

    not much yet

    here is the source

    http://mrbella.com/torrey/mxtest/calendar.fla
    cool stuff

    i'm just starting to play with this but from what i've seen in this forum the prefered syntax is to use the instance names for refs rather creating a variable to remain object oriented, so in this case,

    _root.myDay.text = day[theDay];
    _root.myNumber.text = theNumber;

    rather than

    _root.myDay = day[theDay];
    _root.myNumber = theNumber;

    having removed the variable from the property window and given the same name to the instance instead.




  12. #12
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    Ok, from your fla I can see how you dynamically updat the date.

    How do I then make some text appear for that date.

    Should I store the text for each date as an array also.

    What function do you use to make a variable i.e the text appear or hide.

    Thanks

  13. #13
    Senior Member
    Join Date
    Mar 2002
    Posts
    334
    yeah, personally i'd make an array like

    myArray = Array();

    myArray[11] = "The Text for Jan 1st.";

    then i'd make a text box on the stage and give it a name. Then when you click the date have the function return the day number and month number like and then set the text box to display the array number...

    Well that was some "I just woke up" explination.. but i'll play with this tonight and post the FLA

    Unless some one else has a better idea (i'm sure there is one)

    PS. Thanks for the tip Aversion

  14. #14
    Senior Member
    Join Date
    Mar 2002
    Posts
    334
    Ok check out the SWF and FLA now. I added events for days March 25th and March 29th.

    I'm sure you can do this dynamicly and load in from XML or text files or something.. but this is just a basic idea

  15. #15
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    Originally posted by Squareball2
    Ok check out the SWF and FLA now. I added events for days March 25th and March 29th.

    I'm sure you can do this dynamicly and load in from XML or text files or something.. but this is just a basic idea
    thanks for the time you are spending playing with this thing, I hope the component becomes useful for you.

    I actually figured out how to do that late last night (need more coffee please) The next thing is that I want to be able to click on the text and have more detailed info shown. But I'm using dynamic text to show the event the same way you show the number and day. Is it possible to make that clickable, even better as a rollover?

  16. #16
    Junior Member
    Join Date
    Mar 2002
    Posts
    6
    OK, so I took the .fla and added in a bunch of gibberish to the 29th. It did not display everything I added. It only displayed how ever many chars fit into the window on one line. As well, why is the code for April 25 [325} and not [425]?

    You thought the others were newbies. I squeak!

    Jin


    Originally posted by ethomas
    Originally posted by Squareball2
    Ok check out the SWF and FLA now. I added events for days March 25th and March 29th.

    I'm sure you can do this dynamicly and load in from XML or text files or something.. but this is just a basic idea
    thanks for the time you are spending playing with this thing, I hope the component becomes useful for you.

    I actually figured out how to do that late last night (need more coffee please) The next thing is that I want to be able to click on the text and have more detailed info shown. But I'm using dynamic text to show the event the same way you show the number and day. Is it possible to make that clickable, even better as a rollover?

  17. #17
    Senior Member
    Join Date
    Mar 2002
    Posts
    334

    Smile

    Arrays start with 0
    so Jan = 0
    feb = 1
    and so on...
    I didn't realize that until this morning..

    I'm going to play with it some more tonight after work.. to get it to display more than one line. I too tried to add in a ton of stuff this morning before I left for work.. and found that it will only show one line..

    I am also trying to figure out if there is an easier way to do this..

    I too would like to know how to do it on roll over instead of press...

    Gotta dig through the code and find where it fires the function and make it fire on mouse over instead.. or something..

  18. #18
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    To solve the multiline problem you must first make sure your text box has the multiline property checked and that you make the box large enough to hold the text you want to display. Then here is an example on how to print out 2 lines

    "Hello world\nGoodbye World"

  19. #19
    regarding the calendar... take a look at this
    http://board.flashkit.com/board/show...hreadid=283558

  20. #20
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    Thanks amonteiro,

    for some reason if I try and download your fla I get a screen of garbage.

    Another note, If you highlight the calendar component and click on the blue help book you will find the definitions for the calendar functions.

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