i am new to action script 3.0, i am somewhat familiar with 2.0 and can not for the life of me piece together the coding to make a roll/over and then a roll out animation on a button. I see it quite often i know its possible, but i cant seem to figure it out and its holding me back now in a project that im working on.
i want on the up state for it to just look like asimple button/circl a simple shape. when the user goes over the shape i want there to be an animation int he over state, i want a moveclip to play with that animation and a stop(); to be in that movie clip so when the animation is done it stops, when the use rolls of of the button i dont want it to just snap back to the circle, i want there to be a reverse frame animation on the roll out, i just cant figure out the codeing tho, and how to set it up.....
i found this post....and ran into simular problems....so i couldnt get it to work
http://www.thescripts. com/forum/thread725835.ht ml
ive spent a few hours now trying to find something but all im finding is 3.0.
any advice?
-thanks again
cass
4 17128
Here is what I do for similar issues.
Create a movie clip and in the first frame put the image of the button and a stop() action. Then what you can do, on another layer, is create a duplicate image and put it at 0% opacity and make it a button. Use the following code on that button:
on (rollOver) {
gotoAndPlay(2)
}
on (rollOut) {
gotoAndPlay(10)
}
What you do from this point is make your rollOver animation start at frame 2. Where your animation ends (lets say frame 9), create an animation that basically duplicates your previous animation, only opposite. Since this animation would start on frame 10, when you rollout, it goes to frame 10 an plays your animation. Just make sure that your button layer goes across all frames for it to work throughout.
You can also add:
on (release) {
//Goto Webpage Behavior
getURL("about.h tml","_self");
//End Behavior
}
For more functionality.
great thank you so much, by chance do you know if this also work in action script 3.0? the scripting looks very familiar to 2.0 will this also work in 3.0?
I think it should. I use action script 2 at home but action script 3 at work and I think that I have used the script in both places.
ive tried your solution but cant get button to navigate back to main timeline. is it possible to accomplish this with a button on the main timeline instead of inserting it into a movie clip. any suggestions would be greatly appreciated.. im at the end of my rope and desperate. thanks in advance
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Oxnard |
last post by:
Here's the script section:
function change(color){
var el=event.srcElement
if (el.tagName=="INPUT"&&el.type=="button")
event.srcElement.style.backgroundColor=color
}
function jumpto2(url){
window.location=url
}
|
by: Mike P |
last post by:
what is the syntax for adding a rollover button as an image button? I
have saved the button as a .swf file and put it as the ImageUrl, but
since it isn't an image, do I need to save it as an image in flash
rather than a button?
Cheers,
Mike
|
by: papalazarou78 |
last post by:
Hi
I've been experiementing with actionscripting transitions between sections... this is the first site I have tried this with (last 3 had swf loaded in one after another rather than transitioned between). I used some code from kirupa.com which works for loading movies in and out, but I also have some code for my movie buttons. I can get one...
|
by: Flan |
last post by:
I am running on a Mac, with FlashCS3, using Actionscript 3.0.
First I'm going to say that I am really new to Actionscript. (As in, only been using for a few days new.) So please excuse me if I don't have the terminology down completely.
I am trying to create an interactive button where upon "rolling over" a certain movie clip is played, and...
|
by: somnamblst |
last post by:
I am asking this in javascript and not actionscript because I think the js portion more crucial. I have a viewable area in a SWFcalled box_mc on frame1 that is 300x100 until a rollOver event when it appears to become 300x274 because it has advanced to frame2
I want my actionscript to instruct a div that is 300x100pixels with overflow hidden to...
| |
by: elamberdor |
last post by:
Hi All!
Have a complex roll in / roll out button (ag_mc) that unwraps, then re-wraps a chocolate upon roll in - roll out. However - to complicate things, I would also like another button ( ag_desc) when rolled over / out, to also target/animate/control that other button to animate on the stage as it does as if it was pressed itself...
The...
|
by: Jim in Arizona |
last post by:
using ASP.NET/VB.NET 2.0
I can change the text color of an ASP Button object on mouse
rollover/rollout by doing this (in page_load)
btnMyButton.Attributes.Add("onmouseover", "this.style.color='Yellow'")
btnMyButton.Attributes.Add("onmouseout", "this.style.color='White'")
But how can I change the text on rollover? I don't understand the...
|
by: n7ero |
last post by:
Pls. send me sample files or instructions on how to make an action button like when it hovers, it will go bigger, move or rotate. I have tried many times, but it doest work. I used frame labeling, motion tweening, rollover and rollout. What else should I add?
Specifics: 1. Button = My picture 2. on (rollOver), it will zoom in. on (rollOut), it...
|
by: Oriane |
last post by:
Hi there,
I would like to handle a "rollover" <asp:Buttonin the code behind with C#
with this kind of code:
Button btn = Page.FindControl("Button" + numWidget) as
Button;
btn.Attributes = "document.all." +
btn.ClientID + ".src = '/Images/blue.gif'";
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |