Webforumz's RSS FeedRSS Webforumz RegistrationRegister Contact Webforumz StaffContact

Button, Actions, and Mouse Event problems

This is a discussion on "Button, Actions, and Mouse Event problems" within the Flash & Multimedia Forum section. This forum, and the thread "Button, Actions, and Mouse Event problems are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Nov 20th, 2004, 16:31
Reputable Member
Join Date: Oct 2004
Location: Mobile, AL USA
Age: 47
Posts: 228
Thanks: 0
Thanked 0 Times in 0 Posts
Button, Actions, and Mouse Event problems

I'm having trouble getting a button to accept a mouseover action. I've checked the tutorial in Flash (I have Flash 5) and have followed the directions. The mouse event option in the actions panel is 'gray,' meaning it's not allowing me to use that option. But I'm not sure why.

Here's what I'm trying to do: After the movie has stopped (except the trailing sounds) I want the last frame in a layer, that I converted to a button, to be clickable. Meaning, I would like the option for people to be able to click this image/button to go the the main page URL.

I've converted this image to a button, chose to track as button, but still can't seem to get it to work at all.

Any ideas of what I may be doing wrong?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #2  
Old Nov 20th, 2004, 18:14
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
Ok. my flash is kind of rusty. but lets see. You meant that you created a button and then u converted it into a button symbol. Yeah? Then you open the actions panel and try to add a mouseover? ( I thought the basic and expert mode for A/S is only in flash MX! ). i think I might have got you wrong. Did you mean the "over' state? meaning no programming is involved? as in , theres no "on mouseover" code? if so, that is weird. but in a/s, what cld have gone wrong is you trying to set an on mouseover event to a button which is impossible. you can only set it to movie clips. maybe you could send me the file? email gwx04@yahoo.com.sg
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Nov 20th, 2004, 18:58
Reputable Member
Join Date: Oct 2004
Location: Mobile, AL USA
Age: 47
Posts: 228
Thanks: 0
Thanked 0 Times in 0 Posts
thanks, GW. I kind of get (somewhat, but maybe not at all... lol) the adding a mouseover to a movie clip idea. But again, maybe not. One layer has a 'stop' action to stop the animation on that layer, so maybe that's what's causing the problem? See, my brain is still, out of habit, thinking in terms of HTML, etc. Flash is a new animal to me, and I have NO training. Just winging it really. I'm used to being able to surround something in html tags and getting a result, like putting a link around an image and making it a link. In Flash it doesn't quite work that way, so....

...I convert the symbol in the layer to a movie clip. So if I do that, I can still make the clip image a clickable link image wherever I want in the timeline? I could send you the file, but I want to try it myself first and see if I can make it work. It's driving my nuts not being able to do this. If I can get this right, then I can fix the other movies I'm trying to create and actually use them (now there's a thought! lol).

Also, along the same lines: you can keep, say, one animation in the movie going on one layer, stop it at some point, and keep another going by making it a movie clip symbol? Am I understanding this correctly?

Thanks again.... I'm really floundering along with this. But I refuse to give up!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Nov 21st, 2004, 07:31
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
I believe I get what you're saying!

I think that you double-clicked on the button and then tried to apply actions to the button!

( ps: for my prev comment on buttons not being able to have On events, I was wrong.. I was kind of rusty. And its not onMouseOver, I think theres no such thing. Theres only on(release) and on(press) )

The above-part of what you said - I don't actually get you.. Mmm. Now, sirkent may get you better, but hes not here at the moment. So I'll try my best to understand and respond

You mentioned
"you can keep, say, one animation in the movie going on one layer, stop it at some point, and keep another going by making it a movie clip symbol? Am I understanding this correctly?"

The animation can be many things. It can be a simple "motion tween" on the main movie or it can be animation inside a movie clip. I presume you mean movie clip. Movie clips are independent of each other and yes, can operate on their own. A stop(); in a movie clip doesn't affect another. BUT a stop in a layer stops the whole movie, including your movie clips.

Either my above guess is correct. Or another thing that might have gone wrong, albeit less likely if the tutorial is reliable,...

You mentioned:
"One layer has a 'stop' action to stop the animation on that layer, so maybe that's what's causing the problem?"

Yes, it could be. If you have a layer say, layer 1. and you have another layer, say layer 2. and you have a movie clip in layer 2. if you were to put stop(); in layer 1, then the movie clip will not progress.

Layer 1 --------- [stop] xxxxxxxxxxxxxxxxxxx
Layer 2 --------- xxxxxxxxxxxxxxxxxxx
>m_clip --------- xxxxxxxxxxxxxxxxxxx

--- represents playing.
xxx nothing is playing

Therefore one stop action is universal. It stops the whole flash movie, including a movie clip.

You canNOT precisely stop a specific animation like this. To stop a movie clip, simply click on the movie clip, and set a stop(); action within it.

You can also add a stop action by setting your target. But your target can only be a movie clip! If you have button of instance name myButton, then you try to stop it by myButton.stop()

It doesn't work. It needs to be a movie clip.

Of course, if you have a stop on the exact same frame as the button, then the button events still work.

Another pitfall.

You might have added stop BEFORE the 'on' event. Flash reads from up to down. So it stopped there without looking at the code below stop();

I suggest you redo the whole thing.

If I gt what you say correctly, why not create a blank movie. Create a keyframe on a layer, and then create a button, make it a button symbol. Click onthe button once, and in the actionscript window. Add this:

on (release) {
getURL("http://www.yourwebsite.com", "_self");
}

replace yourwebsite.com with the webbie you want to link. you must have the http there.

now, click on the layer 1. and click on the exact keyframe u created earlier. Apply stop();
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old Nov 21st, 2004, 09:59
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, this stuff has got fairly messy...so let me see...

I'm using Flash MX and I have no problems adding on () to a button... so I'm quite confused as to why you couldn't. All I can think of is that it simply isn't a button, but only a graphic.

I suggest that you upload your FLA file to a website so that we can see it and stop guessing(!) or send it to me directly? karl (replace with at sign) digital-end.com

If you like I can do what you want and send it back, then you can see where you were going wrong?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old Nov 21st, 2004, 10:49
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
Could you please send it to me also
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #7  
Old Nov 21st, 2004, 15:23
Reputable Member
Join Date: Oct 2004
Location: Mobile, AL USA
Age: 47
Posts: 228
Thanks: 0
Thanked 0 Times in 0 Posts
You guys are awesome.

Okay. I zipped the fla file and it's uploaded now. But a couple of things before you get the movie: one, so you don't panic, I have permission to use the image. Another thing is: the movie is whimpy, no bells and whistles... because I wanted to practice Flash I figured this would be one of the easiest I could do so that when I worked on the more difficult ones it wouldn't be as hard.

Some of the problems with this movie: 1) Animation is fast, but that's because I made separate images in photoshop to create the actual animation (you'll see what I mean). 2) There's a large border around the movie that I can't seem to get rid of. I've used the actual image dimensions (367 x 400) but that only moves the image to the right and seems to offset the layers. maybe you guys can figure out why this is happening?

fla file here: http://www.thecorridors.com/moviezip.html

The reason it's important for me to figure out how to link an image in Flash to another URL is because I'm trying to switch (at least) the main pages of this particular Halloween/horror site to Flash. Those movies are still very 'newbie-ish,' but I want them to at least work right... so I'm stuck where they're concerned. Those two movies (swf) are at the links below:

http://www.thecorridors.com/phase2.html (main entrance-like page)
http://www.thecorridors.com/phase_2_main.html (movie the first will be linked to.. if I can figure all this out)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #8  
Old Nov 21st, 2004, 21:00
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, there are a few very simple mistakes here, let me walk you through them.

The first is not really a mistake, but is definetly something you should know to make better Flash animations; try to do as much as you can in Flash!

The second layer contains images which you want to animate over the first. This is fair enough, but the animation you are doing is very simple and there is no need to have individual frames, each with their own 'shiny bit'! There are quite a few images there and therefore you end .swf movie is 168kb for an animation that lasts only a few seconds and, if you blink, you miss it! There is a much better way to do this...

Get the 'shiny bit' that you created and using a good graphics program (Photoshop can definetly do this) save it as a transparent PNG (ask me if you're not sure about this). You can then import this 'shiny bit' into Flash (Flash will preserve it's transparency) and then use Flash to animate this small image moving over your logo, fading in and out. This will look practically identical and give you a file half the size.

Secondly, I'm not really sure why you have a motion tween on the bottom layer. That symbol does not change at all - it does nothing. So there is no need for a motion tween. You'll also notice that (if you click on these frames and then the image) the image on this layer in the first frame is symbol 31 (you can see this in the properties panel), but the image on the last frame is symbol 21. If you want to actually do a motion tween then the symbol before the tween must be the same as the symbol after the tween.

Thirdly, if you simply 'lock' the middle layer (click the small black circle under the padlock on this layer) you'll find you can now directly click on the bottom layer's symbol. It's likely that before you were clicking on the image to access it's actions, but you were seeing the 'actions' entry on the menu greyed out because you were, in fact, selecting the image on the layer above instead! This is definetly something you need to be careful of. Always lock or hide (the eye icon) any layers which you aren't using, if they are in the way of other layers you're currently editing. This takes a little getting used to, but it means that you don't acidentally edit the actions/properties/whatever, of the wrong symbol.

In terms of adding the actions now, you're going to need to have the user click on the movieclip of the image with the 'shiny thing'. I, personally, don't think this would be very easy, as you would need to add this to a movieclip... which can be done but means that the user doesn't see a 'hand' (indicating that there is a link) when they move over a movieclip, even if it is linking. So then you would have to put a button inside the movieclip... and this is when things get unneccessarily complicated.

There's an easier way: On your main timeline (the original timeline with these 3 layers), just make a new layer, above your image with the 'shiny bit' and, wherever you want the button to be, make a large square. Select the square, and convert it into a button. The in the properties panel, under 'Color', choose alpha and set this to 0%. The button will now be invisible, but still work perfectly. You can now add the actions you want to this button...

Ok, quite a lengthy post! Let us know how you get on or if you have any problems!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #9  
Old Nov 21st, 2004, 21:21
Reputable Member
Join Date: Oct 2004
Location: Mobile, AL USA
Age: 47
Posts: 228
Thanks: 0
Thanked 0 Times in 0 Posts
THANK you! That helps quite a bit! The tween I simply forgot to remove. I'd done one thing, changed my mind, and instead of deleting the layer and starting over I 'undid' everything, or so I thought. In my haste.. I didn't even notice.

I knew Flash should animate what I needed animating, but I couldn't figure out HOW to do this. I tried with the standard GIF image (transparent) and it looked hideous. Now, what I used in PS to make the shiny thing on the emblem was to use a lens flare effect, but it wont do that on 'nothing,' and has to be done on an image itself. Unless there's another way I don't know about?

Locking the layers: Man, does my 'greenness' show or what? I noticed that when I'd edit one symbol (an instance of the symbol?) of the image that things would change elsewhere. So lock all the other layers when editing an image or instance of the image?

I wondered about using the alpha to make a button invisible, but I wasn't sure in Flash if that meant you couldn't 'use' that image, if that makes any sense.

Now, back to the shiny thing animation: IF I can figure out how to get a lens flare on a transparent layer, I can use that to animate in Flash. But this makes me think of another problem I'm having: I'm under the impression that once you convert an image to a symbol that it can be used over and over again elsewhere without having to import more images like it, thus reducing file size. That's right? I can't seem to be able to do that. I open the library, see the image/symbol, but can't do anything else with it. Any idea what I may be doing wrong with that?

You must be thinking by now: "This chick needs to buy a book!" lol And you'd be right. I feel a little embarrassed that I'm so far off the mark and expecting help. I do appreciate it, though. I do.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #10  
Old Nov 22nd, 2004, 12:39
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Ok... I've had a good play with this one and I've managed to come up with an almost transparent lens flare by pulling some tricks...

The FLA, PSD and PNG files are here

I think the result looks pretty good... The lens flare might be a little too big, but you can tweak the size and the look with the included PSD (obviously it's always better to make the original image as small as possible outside of Flash).

Here's how the lens flare was done... Make a new layer and fill it with black (or whatever colour will be dominant in your Flash file). Create your desired lens flare effect - preferably centered so that it's as circular as possible. Underneath this layer, create another layer and fill it with a different colour, like green or blue. Back on your top layer, select 'Screen' from the blend mode drop down. The lens flare now seems transparent, but it's not over yet... Disable or remove the coloured layer you made below and you'll see that the lens flare has a black background again. Create a vector mask on your lens flare layer. Choose the gradient tool and select the 'radial' gradient type. Now create a gradient from the center of the lens flare large enough to hide the black outside of the lens flare itself. You'll now have a lens flare with a slight black gradiented edge, but in your Flash movie you'll barely be able to see the black as it's a dominant background colour.

Phew... right. Locking layers: You can actually lock/hide all layers at once by clicking on the eye/padlock itself at the top of the layers list. You can then unhide just the layer you're working on, if you're working on a fiddly flash movie.

Flash is actually pretty clever with images now too... Once something is in the library as a symbol, image or sound, you can re-use it as many times as you like without having to download it again. To get something out of the library, simply drag either the item's name or it's image (as displayed in the library) to the stage.

As for all this help... don't worry about it. It's in the interests of both of us! You because obviously you want to learn Flash and me because it helps the forums... both in terms of helping you (and therefore you coming back and recommending the site to others) but also in the search engines as everything we post drives more traffic to the site. Threads like this are gold dust in the search engines with all these perfectly on topic keywords. If someone searches for transparent lens flare, they'll probably get this page in the near future, especially now I've used the phrase directly again :wink:.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #11  
Old Nov 22nd, 2004, 15:57
Anonymous User
Guest
Posts: n/a
LOL Well it's good to know I haven't caused you a brain bleed! I haven't used masks in PS enough to know how or what to do with them, but I've copied and pasted your post for later reference. Thanks for all the help. And, now I know why I couldn't re-use symbols! It helps if you drag the symbol to the right place!!!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #12  
Old Nov 22nd, 2004, 15:58
Reputable Member
Join Date: Oct 2004
Location: Mobile, AL USA
Age: 47
Posts: 228
Thanks: 0
Thanked 0 Times in 0 Posts
Whoops. Forgot to login before posting. That was me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
button, actions, mouse, event, problems

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 actions on a button fishbyname Web Page Design 1 Nov 16th, 2006 15:25