Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member hagen's Avatar
    Join Date
    Aug 2005
    Posts
    408
    Member #
    10882
    Liked
    1 times
    Hi, I am not very proficient at flash (so below is my first guess) and have struggled to make a movie clip called "picture" that when you hover over it it fades in, and when you roll of it it fades out... See: http://www.jxwd.co.uk/www.tavcom.com...uttonv1.0.html

    (NB there is another picture undernearth it...)

    The action script is below it is very slow and clunky... The onRollOver and onRollOut events are very slow and don't always work well... It also gets tied up if you go on and off the moviscript rapidly...

    Please check out the code and let me know how to make a better job of this...! :-)




    function fade (){
    picture._alpha = brightness;
    if(diff >= 0 or diff <= 100) {
    brightness = brightness + diff;
    }
    }

    function setdiff_positive () {diff=10;}
    function setdiff_negative () {diff=-10;}

    picture.onRollOver= setdiff_positive;
    picture.onRollOut= setdiff_negative;

    brightness = 0;
    diff = 0;
    setInterval(fade,20);


    Hagen Rose: hagen(at)jxwd(dot)co(dot)uk
    JX Web Development, Bournemouth, Dorset...JXWD.co.uk

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    By the looks of things, you call fade every 20 milliseconds? Surely you only want it to fade in/out when the cursor goes in and out respectively.

    Also when a user puts their cursor over picture there is a delay of 20 milliseconds. Perhaps make the second parameter of the setInterval a variable and set it to a lesser value, although 20 milliseconds is not very long!

  4. #3
    Senior Member hagen's Avatar
    Join Date
    Aug 2005
    Posts
    408
    Member #
    10882
    Liked
    1 times
    Hi thanks for the comments...

    I don't see either of those things as being a problem though I supose they are not ideal... Like you say 20 milliseconds is pretty damn quick c.f. a mouse... I did try reducing it...

    Basically I did it like this because I didnt want to initiate several loops which fade in / out especially as they may be conflicting.... but there is clearly flaws in my logic / understading somewhere or it would work properly!

    Maybe somone has a useful example?

    I would really love to have a decent .swf to .fla decompiler... Does anybody know of a free one worth using? so i could get my own examples!

    Cheers -Hagen
    Hagen Rose: hagen(at)jxwd(dot)co(dot)uk
    JX Web Development, Bournemouth, Dorset...JXWD.co.uk

  5. #4
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    The 20 millisecond is not that big a problem.

    Following your logic, lets say I hover over picture, so brightness becomes 10.

    Then I move my mouse off of picture, brightness is still 10.

    Then if I hover back on picture, brightness becomes 20.

    Sorry, I cannot recommend a fla decompiler, Flash is not my back yard!

  6. #5
    Senior Member hagen's Avatar
    Join Date
    Aug 2005
    Posts
    408
    Member #
    10882
    Liked
    1 times
    Yeah Flash is not really my bag, but has been thrust upon me!

    It looks like the logic does work... Give the demo a go...

    Fade will keep adjusting the brightness (in steps of diff) to either 0 or 100 depending on the value of diff... Hence the continuous loop...

    Diff will be either positive or negative always depending on the last action...

    So logic works fine (I think) but it doesn't impliment at all well in Flash!

    Thank you
    Hagen Rose: hagen(at)jxwd(dot)co(dot)uk
    JX Web Development, Bournemouth, Dorset...JXWD.co.uk

  7. #6
    Senior Member hagen's Avatar
    Join Date
    Aug 2005
    Posts
    408
    Member #
    10882
    Liked
    1 times
    Hmmmm I am thinking a twean with a goto and play may actually be the most robust way to do this... even if a little labour intensive...

    I just wanted to make things super configurable I wanted to pass menue items to Flash as a variable from PHP and have it construct them... never mind!

    I would still be very interested if anyone could recommend a decompiler... This would massively help the Flash learning curve!

    Hagen Rose: hagen(at)jxwd(dot)co(dot)uk
    JX Web Development, Bournemouth, Dorset...JXWD.co.uk


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:25 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com