Copy link to clipboard
Copied
I made a button called 'Hardcore' with an instance name of 'Hardcore'.
It is a red-button with white text that says 'Hardcore'. On 'Over' I made the text blue.
On 'Down' I made the text green. And on Hit I made the text white, and the button blue instead of red.
However when I test-it (CTRL+ENTER) the Hit part never works/runs. When I let go of my mouse-click, it instead goes to
the part under 'Over' (Blue text Red button). Anything I'm doing wrong? o.o
the hit frame of a button is never displayed. it determines the region where the mouse triggers the over and down frames.
Copy link to clipboard
Copied
the hit frame of a button is never displayed. it determines the region where the mouse triggers the over and down frames.
Copy link to clipboard
Copied
That sucks. Meh. Thanks :I
Copy link to clipboard
Copied
When I apply the StopAllSounds() [or whatever it was] it says I need an event-handler?
Copy link to clipboard
Copied
you're trying to attach that code to an object.
remove the code, click an empty part of the stage and add the code to the actions panel.
Copy link to clipboard
Copied
Oh right. I'll try it...
Copy link to clipboard
Copied
Alright. I'm using that old invisible code you gave me. Welp, clicking on the Button 'Hardcore' succesfully makes the MovieClip 'DubstepInfo' invisible. However, clicking on the button 'Dubstep' does NOT make MovieClip 'DubstepInfo' become visible. I even put them on the frames, not the objects. Heh. Anything to say? :I
Copy link to clipboard
Copied
var s:Sound=new Sound();
s.attachSound("Dubstep1"); // you need to assign this linkage id to the sound that should play onRelease
Dubstep1.onRelease=function(){
stopAllSounds();
s.start();
}
var s:Sound=new Sound();
s.attachSound("Dubstep2"); // you need to assign this linkage id to the sound that should play onRelease
Dubstep2.onRelease=function(){
stopAllSounds();
s.start();
}
Using this, I can successfully make it so pressing one button quits out all the rest, but for-some reason, they both play Dubstep2.wav. I used Linkage for the songs, and the buttons's names, and instance names are Dubstep#.
Copy link to clipboard
Copied
use:
var s1:Sound=new Sound();
s1.attachSound("Dubstep1"); // you need to assign this linkage id to the sound that should play onRelease
Dubstep1.onRelease=function(){
stopAllSounds();
s1.start();
}
var s2:Sound=new Sound();
s2.attachSound("Dubstep2"); // you need to assign this linkage id to the sound that should play onRelease
Dubstep2.onRelease=function(){
stopAllSounds();
s2.start();
}
Copy link to clipboard
Copied
Yes thank you! Along with the song you pick it changes the name of the text:
Artist: x
Track: y
Do I use the invisible-code or is there some special value for this?
THANK THANK THANK THANK THANK YOU FOR THAT LAST CODE
Copy link to clipboard
Copied
you can add a dynamic textfield to your stage, assign it an instance name (eg, tf) and then assign its text in your onRelease functions:
var s1:Sound=new Sound();
s1.attachSound("Dubstep1"); // you need to assign this linkage id to the sound that should play onRelease
Dubstep1.onRelease=function(){
stopAllSounds();
s1.start();
tf.text="artist: x1, track: y1";
}
var s2:Sound=new Sound();
s2.attachSound("Dubstep2"); // you need to assign this linkage id to the sound that should play onRelease
Dubstep2.onRelease=function(){
stopAllSounds();
s2.start();
tf.text="artist: x2, track: y2";
}
Copy link to clipboard
Copied
**Error** Symbol=DubstepInfo, layer=Layer 1, frame=1:Line 6: String literal was not properly terminated
DubstepText.text="Artist: Skrillex,
**Error** Symbol=DubstepInfo, layer=Layer 1, frame=1:Line 7: Syntax error.
Track: First Of The Year";
**Error** Symbol=DubstepInfo, layer=Layer 1, frame=1:Line 16: String literal was not properly terminated
DubstepText.text="Artist: The Living Tombstone,
**Error** Symbol=DubstepInfo, layer=Layer 1, frame=1:Line 17: Syntax error.
Track: First Of The Year";
Total ActionScript Errors: 4 Reported Errors: 4
Is there any way I can make the font and stuff stay the same?
And I also need to make the Artist part on top of the Track part
Copy link to clipboard
Copied
you can't use this:
DubstepText.text="Artist: Skrillex,
Track: First Of The Year";
use:
DubstepText.text="Artist: Skrillex,\nTrack: First Of The Year";
Copy link to clipboard
Copied
Alright I'll try. Stay tuned.
Copy link to clipboard
Copied
Thank you so much!
But how can I make the MovieClip 'DubstepInfo' invisible from the start
and clicking the Button 'Dubstep' (Symbol and Instance name being 'Dubstep') makes the movieclip
with all the buttons and text appear? I tried using the invisible code but it wouldn't really work out.
Also, the loop-code worked. Thanks!
Copy link to clipboard
Copied
no, 99 is not the max.
there is a max but i don't know what it is. you could experiment if you have a short sound and enough time.
DubstepInfo._visible=false;
Dubstep.onRelease=function(){
DupstepInfo._visible=true; // <- i'm not sure this is the movieclip you want to make visible when Dubstep is clicked.
}
Copy link to clipboard
Copied
Stay tuned, firing up Flash
Copy link to clipboard
Copied
**Error** Scene=Scene 1, layer=Text, frame=377:Line 1: Statement must appear within on/onClipEvent handler
DubstepInfo._visible=false;
**Error** Scene=Scene 1, layer=Text, frame=377:Line 2: Statement must appear within on/onClipEvent handler
Dubstep.onRelease=function(){
Total ActionScript Errors: 2 Reported Errors: 2
Copy link to clipboard
Copied
I accidentally put it on the MovieClip.
So I removed it from the object, and placed this:
DubstepInfo._visible=false;
Dubstep.onRelease=function(){
DupstepInfo._visible=true; // <- i'm not sure this is the movieclip you want to make visible when Dubstep is clicked.
}
On both the Layer keframe that has Button 'Dubstep' and the seperate Layer with the keyframe that has MovieClip 'DubstepInfo'
I made it so it's invisible from the start, but I can't make it visible later on
Copy link to clipboard
Copied
by "it", do you mean DupstepInfo?
if yes, are you clicking Dupstep and failing to see DupstepInfo?
if yes, add the following trace to confirm you are clicking Dupstep:
DubstepInfo._visible=false;
Dubstep.onRelease=function(){
trace(DupstepInfo);
DupstepInfo._visible=true; // <- i'm not sure this is the movieclip you want to make visible when Dubstep is clicked.
}
Copy link to clipboard
Copied
Nope, didn't work.
This is what they look-like:
http://s13.postimage.org/3jwvhpxuf/dub.gif
I still don't know what trace is supposed to do, it never works. In case it helps, for whatever reason, I'm using Macromedia Pro 8.
Copy link to clipboard
Copied
if you fail to see trace output, you either don't have a button named Dubstep when that code executes or you do and you're not clicking it.
Copy link to clipboard
Copied
Fine I'll delete it, and make a new button. Also, how can I make it so clicking the button (hit) makes it a different color. So clicking a blue button will make it Light blue until another is pressed?
Copy link to clipboard
Copied
that can't be done with simple buttons. you have to use movieclip buttons to do that.
Copy link to clipboard
Copied
Eh, ok. Stay tuned.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now