Fade images and OnClick

  • PHANTASM
  • Born
  • Born
  • No Avatar
  • Joined: Jun 19, 2005
  • Posts: 3
  • Loc: BAWLMORE, MERLIN
  • Status: Offline

Post June 19th, 2005, 4:58 am

Hello,

I am a newb when it comes to Flash (mea culpa :wink: ). I have recently been tasked to design a graphic 600x250. The graphic needs to tween alpha 0 - 100 across 110 frames (for each of 4 images total). Therefore the effect I am looking for is like MSN.COM, where the one image on the home page changes/'tweens every 15 seconds. Once the changes occurs a different url is referenced to a different web page depending on what the picture displays.

I know how to tween but I know just a little when it comes to OnClick and pushing the user to a new page on every image change. Should I be jumping from scene to scene or doing it on the same stage?

For our sake let us say that I have 4 images that point to page1.htm, page2.htm,page3.htm and page4.htm. Thanks for your help and your consideration.

RG

Any help would be greatly appreciated!
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 19th, 2005, 4:58 am

  • Tchuki
  • Mastermind
  • Mastermind
  • No Avatar
  • Joined: Sep 30, 2004
  • Posts: 1774
  • Loc: Edinburgh
  • Status: Offline

Post June 19th, 2005, 5:13 am

Code: [ Select ]
onClipEvent(mouseDown) {
if(this.hitTest(_root.xmouse, _root.ymouse, true)) {
if(this._alpha == 0) {
getURL("http://www.yourDomain.com/page1.htm", "_blank");
} else {
this._alpha = -10;
}
}
}
  1. onClipEvent(mouseDown) {
  2. if(this.hitTest(_root.xmouse, _root.ymouse, true)) {
  3. if(this._alpha == 0) {
  4. getURL("http://www.yourDomain.com/page1.htm", "_blank");
  5. } else {
  6. this._alpha = -10;
  7. }
  8. }
  9. }


That doesnt require tweening, all don my AS.

Tweening uses ALOT more CPU time than AS, I would advise you to look into AS.

People have different opinions on scenes. Personally I avoid them like the plague, prefer to dynamicaly load in my movies.
  • PHANTASM
  • Born
  • Born
  • No Avatar
  • Joined: Jun 19, 2005
  • Posts: 3
  • Loc: BAWLMORE, MERLIN
  • Status: Offline

Post June 19th, 2005, 6:19 am

Ok....

So now, since I won't be using be using a tween between graphics, how would I do this staggering each change over to 15 seconds for four images? How does it know which graphic to use? I am not 100% sure about how you would setup the stage so that this could be accomplished? Sorry about the detail, I am in a crunch to get this done.

Thanks for your help,
RG
  • Tchuki
  • Mastermind
  • Mastermind
  • No Avatar
  • Joined: Sep 30, 2004
  • Posts: 1774
  • Loc: Edinburgh
  • Status: Offline

Post June 19th, 2005, 6:34 am

The AS works on the idea that it is placed in the actions panel of a mc [ Movie Clip ].

The line:
Code: [ Select ]
if(this.hitTest(_root.xmouse, _root.ymouse, true)) {

Checks to see whethe the mouse is currently over the mc at all.

Code: [ Select ]
if(this._alpha == 0) {

Checks to see what the current alpha level is of the mc.

Code: [ Select ]
this._alpha = -10;

Change this line to affect the speed in which the mc fades.
  • PHANTASM
  • Born
  • Born
  • No Avatar
  • Joined: Jun 19, 2005
  • Posts: 3
  • Loc: BAWLMORE, MERLIN
  • Status: Offline

Post June 19th, 2005, 7:22 am

Enigmatic! Outstanding Job! Thanks for all your help! If everyone here is this helpful, this is probably the best resource on the web! Your help is greatly appreciated!

RG

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 30 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.