PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Mouse scroll navigation and preloader problems
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Mouse scroll navigation and preloader problems

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    2

    Mouse scroll navigation and preloader problems

    Hey, I got couple questions that I have been trying to find out with no luck, (seen a lot of tutorials o.O).

    I am trying to make a site using mouse scroll, moving mouse to left or right and ‘frontpages’ would move accordingly (new frontpages would come out from sides of the the screen if any. Otherwise it would stop to the last one. I don't want it scroll to infinity).

    The navigation would work using large ‘buttons’ as a frontpages to the content behind them. The content would open by clicking ’frontpage’ and sliding contents (2) from underneath the ‘frontpage’ while doing that other ‘frontpages’ would move to the right. Closing would work by clicking the content and it would slide back in, closing the gap.

    How can this be done? I have found tutorials that do the mouse scroll with jquery or smt. But what about as3? And how to do the contents sliding in and out?

    The other problem that I have is coding preloader that makes something happen when code has calculated that ie. 10% has been loaded and yellow light would come on, 20% some other light and so on. I was thinking that if I would make a movieclip and it would have animation per 10%, but how can I start those when needed?

    Any ideas?
    I'm lost with these, got everything else done for the site.

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Russia: Western Siberia
    Posts
    268
    got everything else done for the site.
    Really? What is everything else? Graphics?

    How can this be done?
    Read docs on MouseEvent's first.
    After you're done with that, add event listeners to whatever you want to be a "button"
    And after the event is received handle it, e.g. add tween to your content container or what ever you want to move.

    The other problem that I have is coding preloader that makes something happen when code has calculated that ie. 10% has been loaded and yellow light would come on, 20% some other light and so on. I was thinking that if I would make a movieclip and it would have animation per 10%, but how can I start those when needed?
    Look at ProgressEvent, and its bytesTotal and bytesLoaded properties.
    take bytesTotal as 100% and calculate how many percents have been loaded like this:

    Actionscript Code:
    var percent:int = Math.floor((event.bytesLoaded / event.bytesTotal) * 100);
    and then check the percentage:

    Actionscript Code:
    if (percent > 20) // do something
    else if (percent > 40) // ...

    And it would look really dumb, especially if you have a fast connection )

  3. #3
    Junior Member
    Join Date
    Mar 2011
    Posts
    2
    Really? What is everything else? Graphics?
    Haha, that too.

    And it would look really dumb, especially if you have a fast connection )
    That one of my concerns but I wanted to do something different.
    My preloader code at least was working but not where it checks if 10,20,... has been loaded (well, it did check it but my coding was off and it showed me true10 if percent was 10-19). I think I'll get it working now.

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