A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: I need some serious help please

  1. #1
    Junior Member
    Join Date
    Feb 2009
    Posts
    14

    I need some serious help please

    ok this is what I am trying to accomplish. and I am quite shocked I have not been able to find a tutorial on how to do this anywhere on the web. I have been searching for days inbetween reading all I can on actionscripting.

    Ok here goes what I am trying to accomplish: I have a video gallery I am trying to put together there will be a total of 10 videos in the gallery, but for the sake of trying to figure out how to accomplish this we are just going to say I have a single video thumbnail approximately 100x125 px what I want to happen is when I mouse over the video I want the video to start playing. When I mouse off the video I want it to stop playing where it was at when the cursor left the thumbnail area.

    Anytakers??? Someone has to know how this is done, or know of a tutorial on how to do this.

    Oh and I am doing this is CS4 with actionscript 3.0

    I tried it as a button symbol but it jumps back to the first frame when the cursor leaves the button area.

    PLEASE PLEASE HELP ME!

  2. #2
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    I havent' used CS4 before, but I'm assuming that AS3.0 hasn't changed. Instead of using button for the movieclips, you need to use event listeners.

    I would first have each video posted within a movieclip. You can use properties of that movieclip to store the current framehead position when the user mouses off the symbol.

    Using listeners you can call different functions to store the information within the individual movie clip....it would probably make it easier if you use a class file for the movieclip.

    Does any of this make sense? Have you researched event listeners?
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  3. #3
    Junior Member
    Join Date
    Feb 2009
    Posts
    14
    samac, thank you so much for your reply.

    I am very new to flash and actionscript so I havent used event listeners at all yet. Could you point me to some good articles on the eventlisteners, functions and class files that I would need to make this possible? any additional help you could give me would be awesome.

    Again thank you for an intelligent response to my question. Ive been all over a bunch of other forums and the only responses I get are advertising crap.

  4. #4
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    I primarily use FlashKit, Flash CS3 books and the adobe livedocs. There is enough information for you to translate the reasons and actions of each line to get the job done.

    Event Listeners are very useful and something you'll use frequently. Class are another beast all together and you'll use them ALL THE BLOODY TIME when using CS3. Happy to help.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  5. #5
    Junior Member
    Join Date
    Feb 2009
    Posts
    14
    Thanks for the help. I scowered the web and this AS3 book I got and came up with some code that works for what I want it to do.

    Honestly what I am trying to do with this is make 12 planetoid videos buttons. I have the rollover, rollout, and looping on the videos all finished now thats in large part to you pointing me in the right direction. Now I need to figure out how to add a clicked state, basically I just want to darken the image that I already have, either by just showing a single black circle over the video with 50%opacity or somehow dynamicaly tyeing the tint control in with AS3.

    Ill post the code Im using right now and maybe you could take a look at it and suggest how to apply the clicked state.

    Thanks Man!

    Chris

  6. #6
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    No problem. Should be able to work something out when you post the code.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  7. #7
    Junior Member
    Join Date
    Feb 2009
    Posts
    14
    Thanks,
    Here is the code. I got the clicked state working with the Mouse_Down event. I created a movie clip with just a black circle and placed it over each video, instanced each _mc and then tied them into the code.

    So is there any way you can think of to steamline the code at all? I have twelve buttons and alll have this code copied to them in the main timeline.

    Thanks!
    Chris

    planet1_btn_mc.addEventListener(MouseEvent.ROLL_OV ER, playMovie1, false, 0, true);
    planet1_btn_mc.addEventListener(MouseEvent.ROLL_OU T, stopMovie1, false, 0, true);
    planet1_btn_mc.addEventListener(MouseEvent.MOUSE_D OWN, onDown1, false, 0, true);
    planet1_btn_mc.addEventListener(MouseEvent.MOUSE_U P, onUp1, false, 0, true);

    function playMovie1(e:MouseEvent):void
    {
    planet1_btn_mc.play();
    }

    function stopMovie1(e:MouseEvent):void
    {
    planet1_btn_mc.stop();
    }

    function onDown1(e:MouseEvent):void
    {
    this.planet1_btn_mc.planet1_btn_clicked_mc.alpha =.4;
    }

    function onUp1(e:MouseEvent):void
    {
    this.planet1_btn_mc.planet1_btn_clicked_mc.alpha =0;
    }

Tags for this Thread

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