A Flash Developer Resource Site

Results 1 to 20 of 20

Thread: can this be done?

  1. #1
    Senior Member
    Join Date
    Oct 2000
    Location
    York, Pennsylvania
    Posts
    380
    http://www.flashkit.com/movies/Effec...79/index.shtml

    I can get close to this effect, but I cant get the scale back to normal on mouse out to work like this one does.. can someone that knows how this is done correctly do a demo file that shows how this is done in KM?

    My effect works great zooming in, but the reverse on mouse out looks like ...well... we wont say....


  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    I can do one better. I can make it so that it only zooms when you mouse on the rectangle.

    If you have 3.0 do this;

    1. Start a new movie and create a clip. Add your Picture and square.

    2. Add this code to the square in 2 actionscripts.

    on(rollover){move="IN"}
    on(rollout){Move="OUT")

    3. Now on Frame 1 add this code.

    if(this._xScale<900){
    if(move=="IN"){this._xscale+=1;
    this._yscale+=1;
    }
    }

    if(this._xscale>0){
    if(move=="OUT"){this._xscale-=1;
    this._yscale-1;
    }
    }

    4. Add a second Frame and add a Goto and Play Frame 1 action.

    I dumped an example here http://jsnider.0catch.com/Scalein%20and%20out.html

  3. #3
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087

    OOPS!!!

    I forgot to test for the _yscale being less than 0 causing some interesting results, plus I left off an = sign... Bad me. Also you may not want to scale all the way down to 0 unlis you like making things disapear.

    Change the Frame Script to;

    if(this._xScale<900){
    if(this._yscale<900){
    if(move=="IN"){this._xscale+=1;
    this._yscale+=1;
    }
    }
    }

    if(this._xscale>50){
    if(this._yscale>50){
    if(move=="OUT"){this._xscale-=1;
    this._yscale-=1;
    }
    }
    }


    The script will scale anything in the Movie Clip when you Roll in and out of the button.




    [Edited by johnie on 02-19-2002 at 10:45 PM]

  4. #4
    Senior Member
    Join Date
    Oct 2000
    Location
    York, Pennsylvania
    Posts
    380
    actually... is there a way to get a magnifying glass effect?

    I am looking to have an image, and have a circle drawn over it with a transparent fill... then when the mouse moves over it, the image is zoomed, but only withing the circle. The remainder of the image stays static. I have played with this using fills of the circle with the image, but it converts to a symbol before adding AS..so the zoom is made on all instances.

    Any ideas?

  5. #5
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    It's all done with mirrors ( mc's and masks actually) Here is a tutorial I found on Flash Kit:

    http://www.flashkit.com/movies/Effec...69/index.shtml

    Not sure if this can be done in KM, but I'm sure you will have fun trying

    Hilary

    --

  6. #6
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    That is pretty lame and yes it can be done.

    This is what you do.

    1. Create your Text. It has to be regular text and not dynamic text.

    2. Copy it and paste it. Scale and position your new text so that is over your other text. Turn this into a mask and set its depth to 1 layer. Hit F9 and label this as mask.

    3. Draw your magnifying Glass- Do this off on the side. Select your shapes and convert to a Clip. It is important that on the layer of your Magnifying Glass Clip matches the Background. Hit F9 again and name this clip Mag2

    4. In the Main Movie Draw an Oval, or square or whatever shape your Glass is in. Over the Magnifying Glass. Make sure the color is the same color as your text. Convert to a Movie Clip then hit F9 and label this Mag1.

    5. Double click Mag1 and add this script;

    OnClipEvent(MouseDown){
    _root.Mag1._x=_root._xmouse;
    _root.Mag2._x=_root._xmouse;
    _root.Mag1._y=_root._ymouse;
    _root.Mag2._y=_root._ymouse;
    }



    6. Now Move your Move Mag1 and Mag2 so that they are under Mask. It is important that Mag1 is higher than Mag2.

    Viola- Moving Magnifying glass effect-sorta it only moves where you click it. It is possible to make it move around with some additional scripting- the scripting is minimal.



    [Edited by johnie on 02-20-2002 at 02:37 AM]

  7. #7
    Senior Member
    Join Date
    Oct 2000
    Location
    York, Pennsylvania
    Posts
    380
    thanks everyone...

    I am trying to represent the view thru a sniper's scope...

    basically showing an image of a wooded area with a deer in the distance, then when you click a scope view comes up magnifying it in a crosshairs view within a circle to represent the scope, leaving everything outside the circle as it was.

    I plan on trying a similar effect with two circle as if the view were thru binoculars.

    If anyone has any examples of this, it would be greatly appreaciated, and would serve as a great demo effect for koolmoves itself.

  8. #8
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    Shoot- Wht didn't you just tell me that was what you wanted in the First place- It would have saved us some trouble.

    Indeed this also can be done.

    This is how;

    1. Start a new Movie. Import the Photo You Want.

    2. Now Create a clip (MC1).

    3. Create another New Clip(MC1 inside MC1) while inside your first clip.

    4. Import the same photo and Enlarge it inside the clip. Exit this clip you are done here(MC1 inside MC1).

    5. Now Inside your first Clip (MC1) you should see the Photo- It may look strange in the clip- Don't wory its not really tiled. Draw A Circle or whatever you want centered at the Crosshair. Double Click it and set it to mask with a level of 1. Now Draw whatever else you may want.

    6. Click on your second clip (MC1 inside MC1) to get to its properties. Add this script;

    onclipevent(enterframe){
    this._x= Math.Round(_root._xmouse)*-1+250;
    this._y=Math.Round(_root._ymouse)*-1+150;
    }

    Now that +250 and +150 is actually dependant upon how large your movie is. That value should really be 1/2 the size of your main movies Width for X and Height for Y.

    7. Now Click to Main Movie. Double Click Your Clip (MC1) to get the Properties Dialouge. You will add this script;

    onclipevent(enterframe){
    this._x=_root._xmouse;
    this._y=_root._ymouse;
    }

    I dumped My example here:

    http://jsnider.0catch.com/Magglasexamp.html

  9. #9
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    Cool stuff Johnie - well done.

    Hilary

    --

  10. #10
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    That is a very cool effect.

  11. #11
    Member
    Join Date
    Jun 2001
    Posts
    94

    WOW johnie!

    Really very nice johnie!

    Is it true if your boating pic was a vector image you could continue to increase the magnification with out seeing pixels?

    Is there a step by step "how to" for KoolMoves? just to get me started?

    I must admit I'm a bit intimidated by the code and have not even tried -but it certainly looks very useful. I have done my own HTML web stuff with notepad but have great ref. material and I also have a wysiwyg web page creator/editor. I don’t want to waste your time with these very basic questions so pointing to some KoolMoves how 2 would help.

    I’m guessing instruction for Flash would be different enough to thwart me!

    For instance:
    2. Now Create a clip (MC1). Is this a movie with in a movie?
    3. Create another New Clip(MC1 inside MC1) while inside your first clip. How???
    6. Click on your second clip (MC1 inside MC1) to get to its properties. Add this script;

    onclipevent(enterframe){
    this._x= Math.Round(_root._xmouse)*-1+250;
    this._y=Math.Round(_root._ymouse)*-1+150;
    }
    Where does this get added?? etc. etc.....


    Thanks for any clue!

    Bob C.

  12. #12
    Senior Member
    Join Date
    Oct 2000
    Location
    York, Pennsylvania
    Posts
    380
    were getting close to the desired effect...

    johnie... very close... but is there a way to have the circle move about and show the normal sized image thru it, then when mouse clicked it zooms in as if adjusting the magnification power?


  13. #13
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    Originally posted by mmreed
    were getting close to the desired effect...

    johnie... very close... but is there a way to have the circle move about and show the normal sized image thru it, then when mouse clicked it zooms in as if adjusting the magnification power?

    Yes, I'll look at it and get back on it. Theoretically if you combine the method in the example in my first post and the method in my last example this is possible. I'll have to actually do it to have all the details.


  14. #14
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087

    Re: WOW johnie!

    Originally posted by Bob C.
    Really very nice johnie!

    Is it true if your boating pic was a vector image you could continue to increase the magnification with out seeing pixels?

    Is there a step by step "how to" for KoolMoves? just to get me started?

    I must admit I'm a bit intimidated by the code and have not even tried -but it certainly looks very useful. I have done my own HTML web stuff with notepad but have great ref. material and I also have a wysiwyg web page creator/editor. I don?t want to waste your time with these very basic questions so pointing to some KoolMoves how 2 would help.

    I?m guessing instruction for Flash would be different enough to thwart me!

    For instance:
    2. Now Create a clip (MC1). Is this a movie with in a movie?
    3. Create another New Clip(MC1 inside MC1) while inside your first clip. How???
    6. Click on your second clip (MC1 inside MC1) to get to its properties. Add this script;

    onclipevent(enterframe){
    this._x= Math.Round(_root._xmouse)*-1+250;
    this._y=Math.Round(_root._ymouse)*-1+150;
    }
    Where does this get added?? etc. etc.....


    Thanks for any clue!

    Bob C.
    Those are directions for V 3.0.

    The add clip button is the button 3rd down on the left (Its got a Picture of a REEL on it) on the Drawing Toolbar. If you click the button it allows you to create a movie within the Movie which plays on its own timeline. It is also important to note that only Clips properties can be manipulated with AS, although text and levels can be manipulated to a lesser degree.

    If you have not upgraded then this effect is still possible but is much harder to do. In 2.80 Clips were SWF Objects and had to be exported and then re-imported into KoolMoves. Onclipevents also were not avialble in 2.80. OnClipevents can be simulated though using Buttons and Frame Actions.

    Anyhow when you select a clip in KoolMoves V 3.0 you get a property Box. In the property Box you can put an OnClipEvent AS on it. Bob is working on GUI based Button Actions for Clips which will simplify things a bit.

  15. #15
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    Okay,

    I have it working. I tried to adjust for drift when scaling but tried as I might I never did get it working 100%

    Anyhow The process was quite gruelling (AKA if you do something like this for a money charge quite a bit for it) so I am just going to post the Example with a Zip of the .FUN

    Perhaps someone with Fresh eyes can look at my code and see where I went wrong with the Adjustments script?


    Anyhow the File is dumped here: http://jsnider.0catch.com/mag3.html






  16. #16
    Senior Member
    Join Date
    Oct 2000
    Location
    York, Pennsylvania
    Posts
    380
    Originally posted by johnie
    Okay,

    I have it working. I tried to adjust for drift when scaling but tried as I might I never did get it working 100%

    Anyhow The process was quite gruelling (AKA if you do something like this for a money charge quite a bit for it) so I am just going to post the Example with a Zip of the .FUN

    Perhaps someone with Fresh eyes can look at my code and see where I went wrong with the Adjustments script?


    Anyhow the File is dumped here: http://jsnider.0catch.com/mag3.html
    VERY VERY VERY CLOSE! Now all that is needed is to have the zooming recenter the zooming clip so that the it is recentered on the centerpoint of the circle.

    I am playing with a few examples from other sources, but cannot get them to work as well...

    there has to be a way to have the circle over the image and zoom so it zooms on the center point and keeps recentering so the drift does not happen...

    I have a few ideas, and will post them shortly if I get them to work....

    I think today I will buy an AS book over lunch... any reccomendations?



  17. #17
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    Originally posted by mmreed
    Originally posted by johnie
    Okay,

    I have it working. I tried to adjust for drift when scaling but tried as I might I never did get it working 100%

    Anyhow The process was quite gruelling (AKA if you do something like this for a money charge quite a bit for it) so I am just going to post the Example with a Zip of the .FUN

    Perhaps someone with Fresh eyes can look at my code and see where I went wrong with the Adjustments script?


    Anyhow the File is dumped here: http://jsnider.0catch.com/mag3.html
    VERY VERY VERY CLOSE! Now all that is needed is to have the zooming recenter the zooming clip so that the it is recentered on the centerpoint of the circle.

    I am playing with a few examples from other sources, but cannot get them to work as well...

    there has to be a way to have the circle over the image and zoom so it zooms on the center point and keeps recentering so the drift does not happen...

    I have a few ideas, and will post them shortly if I get them to work....

    I think today I will buy an AS book over lunch... any reccomendations?


    The Mook Book- Its the best of the whole lot. Make sure you Eyeball the book real good before you buy it- I went into a bookstore the other day and checked out about a half-dozen Flash books and they were mostly junk.

  18. #18
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    Yes,
    "ActionScript, The difinitive Guide" by Colin Moock is the best I have seen so far.

    http://www.moock.org

    Hilary

    --

  19. #19
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    Subsitute out This Script;

    if(state=="down"){
    this.mover._xscale+=5;
    this.mover._yscale+=5;
    xgrow=(((this.mover._xscale*0.01)*500)-500)/2;
    ygrow=(((this.mover._yscale*0.01)*500)-500)/2;
    scale=((this.mover._xscale*0.01)*500)-500;
    if(_root._xmouse>250){
    this.mover._x-=xgrow/4;
    }
    else if(_root._xmouse<250){
    this.mover._x+=xgrow/4;
    }
    if(_root._ymouse>150){
    this.mover._y-=ygrow/4;
    }
    else if(_root._ymouse<150){
    this.mover_y+=ygrow/4;
    }
    }

    http://jsnider.0catch.com/mag4.html

    It could be taken further but by adding or subtracting out the Radius but that should do.

  20. #20
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    Looking at it I realized that I goobered it a bit. The ygrow should have 300 instead of 500 in the setting.

    http://jsnider.0catch.com/mag5.html

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