A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [RESOLVED] Need help with coding/scripting!

  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    4

    resolved [RESOLVED] Need help with coding/scripting!

    Hi everyone,

    I am trying to make a flash website using the same functions as this one http://events.q-dance.com.au/2011-09...ember_defqon1/ but I have no idea how to make it transition from left to right. I know that I have to put the background image(convert to movieclip) as 1 layer and put labels on them but I am unsure about the action script/coding needed.

    If someone can pleasee help me with the coding and telling me the best way to make my website function transition left and right using buttons then it'll be very much appreciated! Thank you!!

  2. #2
    Registered User
    Join Date
    Jun 2012
    Posts
    4
    Has to be made using only adobe flash! No other programs .

  3. #3
    Senior Member Steven FN's Avatar
    Join Date
    Mar 2010
    Location
    CA, USA
    Posts
    276
    I would put the background image into a MovieClip and then use the Tween class to animate the background panning. Could use greensock's TweenLite.

  4. #4
    Registered User
    Join Date
    Jun 2012
    Posts
    4
    Thank you ! What is greensocks tweenlite btw ? Lol sorry

  5. #5
    Senior Member Steven FN's Avatar
    Join Date
    Mar 2010
    Location
    CA, USA
    Posts
    276
    It is a tweening engine by Greensock, which has better performance then Flash's built-in Tween class. For your purpose, i think the Tween class will perform satisfactory.

  6. #6
    Registered User
    Join Date
    Jun 2012
    Posts
    4
    flash code isn't working.. I need to make it kind of like this how it is panning http://www.webdesigndev.com/flash/ho...bsite-in-flash but the thing is that only works on using one key frame... Mine has a few key frames which has labels and a movieclips as the background images. I need a code to make it work. Here is an image of my work so far. I put the easeOut transition on but still isn't working the way I want to.

    Here's my codes so far that doesn'nt work

    stop();

    home_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);

    function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):voi d
    {
    gotoAndStop("home");
    }



    info_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);

    function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):v oid

    {
    gotoAndStop("info");
    }



    stages_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_3);

    function fl_ClickToGoToAndStopAtFrame_3(event:MouseEvent):v oid
    {
    gotoAndStop("stages");
    }



    stage1_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_4);

    function fl_ClickToGoToAndStopAtFrame_4(event:MouseEvent):v oid
    {
    gotoAndStop("stage1");
    }

    stage2_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);

    function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):v oid
    {
    gotoAndStop("stage2");
    }



    stage3_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_6);

    function fl_ClickToGoToAndStopAtFrame_6(event:MouseEvent):v oid
    {
    gotoAndStop("stage3");
    }



    stage4_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_7);

    function fl_ClickToGoToAndStopAtFrame_7(event:MouseEvent):v oid
    {
    gotoAndStop("stage4");
    }



    photos_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_8);

    function fl_ClickToGoToAndStopAtFrame_8(event:MouseEvent):v oid
    {
    gotoAndStop("photos");
    }

    import fl.transitions.Tween;
    import fl.transitions.easing.*;

    var homeTween:Tween = new Tween(home_mc, "x",Strong.easeOut, home_mc.x,0,1,true);

  7. #7
    Senior Member Steven FN's Avatar
    Join Date
    Mar 2010
    Location
    CA, USA
    Posts
    276
    Try the following to see if it animates, if i remember the Tween class, this should move it horizontally:

    var homeTween:Tween = new Tween(home_mc, "x",Strong.easeOut, 0, home_mc.x+home_mc.width,1,true);

    If it does work, then you would then use "homeTween.continueTo(230);" to move the background image to the desired x position.

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