Keeping Clicks To One Layer
How can you create slideover screens (within one flash movie) that prevent your clicks from hitting the main interface below the slideover screen? I have a simple game, and I want an instruction screen to slide over the game and allow you to close the slide over screen when finished. The problem is that a click does two things at once, it closes the slide over screen and counts as a move in the game below.
How can I keep it from clicking too many things at once?
- Fun
Ultrashock Forums > Flash > ActionScript
Posted on: 2006-03-05
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Keeping Clicks To One Layer
How can you create slideover screens (within one flash movie) that prevent your clicks from hitting the main interface below the slideover screen? I have a simple game, and I want an instruction screen to slide over the game and allow you to close the slide over screen when finished. The problem is that a click does two things at once, it closes the slide over screen and counts as a move in the game below.
How can I keep it from clicking too many things at once?
- Fun
Keeping Clicks To One Layer.
How can you create slideover screens (within one flash movie) that prevent your clicks from hitting the main interface below the slideover screen? I have a simple game, and I want an instruction screen to slide over the game and allow you to close the slide over screen when finished. The problem is that a click does two things at once, it closes the slide over screen and counts as a move in the game below.
How can I keep it from clicking too many things at once?
- Fun
Keeping Clicks To One Layer.
How can you create slideover screens (within one flash movie) that prevent your clicks from hitting the main interface below the slideover screen? I have a simple game, and I want an instruction screen to slide over the game and allow you to close the slide over screen when finished. The problem is that a click does two things at once, it closes the slide over screen and counts as a move in the game below.
How can I keep it from clicking too many things at once?
- Fun
Keeping Track Of Clicks
I'm developing a small application that lets you pan around a dinosaur dig site and collect bones. I cannot figure out how to track when I have collected all of the bones. And it should not matter what order you collect them. I just want it to jump to scene 2 when all bones have been collected.
Can anyone help?
Keeping Track Of Clicks With Shared Object
I'm trying to write a function that keeps a running count whenever a button is clicked - and then writes the count to a Shared Object cookie. Here's the code:
Code:
function counterVar() {
var elemSharedObject:SharedObject = SharedObject.getLocal("elementChoices", "/");
countClicks = elemSharedObject.data.itemCount;
if (elemSharedObject.data.itemCount == 'undefined' || '' || 'NaN') {
elemSharedObject.data.itemCount = 1;
elemSharedObject.flush();
countClicks = 1;
} else {
countClicks++;
elemSharedObject.data.itemCount = countClicks;
elemSharedObject.flush();
}
}
And the button code looks like this:
Code:
function click(bt:Object):Void {
if (bt.target == table_mc.p1_bt) {
var elemArray:Array = new Array(_root.p1, _root.i1, _root.e1, _root.en1);
var elemArrayName = "elemArray_" + _root.countClicks;
storeData(elemArrayName,elemArray);
//Alert.show("You've added " + _root.i1 + " to the cart");
counterVar();
} //else if...
}
Everytime it runs the count gets reset to "1", endlessly. Obviously the logic is flawed. Can anyone help out here?
Buttons On Lower Swf Layer Registering Clicks
Hi,
I am having a few problems working out how to stop a silly issue with my site. (see. www.pumaknight.co.uk)
I have the site set up where it loads a swf over the master swf when you go to view a gallery. However, the buttons in the master swf, behind the loaded swf are still registering clicks.
So if a view clicks by accident whilst viewing a photo, it goes back to the menu page.
I thought when you loaded a swf voer another one, it would hide the one below both from view and in functions.
Does anyone know how I can stop this?
Thanks
Keeping Shapes Separated On 1 Layer
Forgive my ignorence, but how the **** can I draw 2 overlapping shapes of the same color on 1 layer without them being glued together as 1 large shape by Flash??? Also, when I draw a selection rectangle over the shapes to select one or both, how do I get Flah to recognise the original shape & not to take out a piece the size of the selection? MANY THANKS!
Handling Double Clicks And Mis-clicks In AS3
Hi
I am making point n clicked based game. From time to time my moving objects stop and I assume this is happening due to me not handling double mouse clicks and mouse mis clicks. I would like to know how I can handle double click and mis clicks in AS3.
Thanks
P.S. To get a better understanding of what I mean, play my game at:
http://freelancer.987mb.com/download/fla/Gool/Gool.html
Its still under development.
Is There A Way To Do Something If The User Right-clicks And Clicks "forward"?
i have a game that im submitting somewhere. and i dont want anyone cheating by right-clicking and going forward. i know you can disable the menu, but for some reason once it is submitted, the window in which it is viewed in puts the menu back..and i have no control to edit the html in it...so, is there anyway to fix this? or , is there anyway to do a certain action when "forward" is clicked? thanks.
Erasing The Top Layer With A Line To Show The Layer Beneath It
I was curious if anyone would be able to help me out. I have a layer that is a menu with some buttons. When a button is hit, I'd like to do this: A line from above the menu will go down the page, and as it goes down it apperas to erase the menu layer and show the layer beneath it. So as it goes down, what is beneath the line is still the menu page but above the line is the information (movie clip) that should be shown to that corresponding button. Any one have any ideas?
Thanks
Have a Happy New Year
Ty
Creating A Delay/Pause, Frome Layer To Layer.
Hello,
I'v been having trouble with my newest project, i'm trying to create a pause from it going from 1 layer to the next without using frames.
If i use the frames my project just messes up, so im trying to create a pause of going from frame 1 to frame 2 to frame 3 up to 20.
If someone could help me i'll be really great full.
Layering Problem: McText (layer 1) Over McText2 (layer 2)
Hi,
Quickie: Have 12 layers. Base layer has some text (mcWelcome) and a popup on layer
8 with some text plays over it. When I do a a href link to bring up the next mcTextfield combination
on top of the layer 8 the new layer goes under all other layers even though its on layer 10 (it has an arrow and a textfield).
In Design mode it is on top but when it plays it (layer 10 mc) plays under even the first layer.
What am I doing wrong? No matter where I drag the layer containing that new movie clip it goes underneath. Made
a new layer and it does the same thing adding text with ActionScript.
I've even done the "bring to front" and it has no effect. Why is the new mcText alway below the other layers?
Any ideas?
Thanks,
Thanks,
Control Audio In Layer 0 From Movie In Layer 2
I have a sound (mySound) playing from a movie in layer0 (default movie). this movie has loaded another movie into layer 2 using loadmovienum.
I want to stop the sound from playing while in the layer 2 movie. I have tried using _layer and _root but I can't reference the sound.
Can someone tell me how to reference the sound and either stop it or set the volume to 0 from within layer 2 if the sound object is in layer 0?
thanks in advance
Can You Put A Guide Layer Inside A Masked Layer?
Here's the situation: I've got a flash animation in which one character is dreaming. I put a balloon over his head. I want to put a bicycle inside this balloon which comes into the balloon, circles around once and then exits the balloon. I've masked the ballloon so that the bike isn't seen before it enters the balloon, but now I want to put a guide layer above the bike layer so that the bike can circle around a bit before it exits.
I don't see any info on this in any of my Flash books. Is there any way to put a layer, with its guide layer above it, inside a masked layer?
Thanks for the help.
Behavior In One Layer Automatically Carries On To Any Layer
I hate to be a pain, but I am really trying to learn a lot by following tutorials and this problem is reoccuring with every tut I try...
I am following this tutorial: [L=http://www.entheosweb.com/Flash/preloader2.asp]
I am stuck on this (have redone it at least 17 times following verbatum but something isn't right):
Now come back to your bar layer, Push the rectangle to the left as shown below
Go to Frame 40, keeping playhead on frame 40, pull the rectangle onto the other side as shown below
My problem is that when I move it in frame one, it also moves in frame 40... and when I move it to the other side in frame 40 and go back to frame 1 it is no longer in the original position... I can't get my head around this!!! I am using Flash 8 Professional if that's any help!
I am inserting frames and not keyframes, just like the tutorial says...
_root.layer.layer? Simple Question
so im having some problems getting the right item targeted and feel that im writing the as wrong.. so here is what i have.. the stage. with a mc .. then inside that a button.. so wouldnt it be like this?
_root.mc.button
Guide Layer, And Mask Layer Problem
I have a small problem, and it might be possible i just been looking at things the wrong way.
I currently have a symbol on a guided layer, that follows a path when my movie is played. The symbol starts off small, and grows as it reaches the end of the path.
The problem i'm having is, the symbol is overlapping the outside border of my background layer. I'm trying to make the symbol look like its behind the border of my background layer.
I know this can achieved using a mask, but as the symbol is already on a guided layer..Flash won't let me apply it to a layer mask.
Is there any other way around this?
Thank you in advance for your replies.
Moving Background On 1st Layer Static On 2nd Layer
Hello I'm a beginner in flash, can someone please show an example code of how to have a smooth slow moving background (image), and then on top of that have a static image (that makes the border of the movie, like a picture frame) with the middle being transparent so you can see through the moving background.
Can this be done with the flash rectangle tool so I don't have to use an image for the border?
I managed to make the 1st layer have the moving picture in a loop with motion tween, but in the 2nd layer my "picture frame" does not even show when I test the movie.
How To Make One Layer Loop And One Layer Static?
I have an interactive Flash application that prompts users and moves them backwards and forwards to different frames.
While this is happening can another layer loop? At a high level can someone please explain what I should be doing to achieve this?
~ Humour
Keeping Character On Stage Plus Keeping Moving Background With Character On Stage
Im in the process of creating a superman game.. and i right now have him in walking mode .. i created him which is superman_mc . which has his waking animations etc.. inside and i have created a background mc which is level1_mc which basicly moves along with superman as he walks. .the problem i am getting is keeping the back ground from moving off the stage and superman from going off the stage i can keep superman on the stage and in one place on the stage with the code i have now but the background still moves off.. here is the code i have :
stop();
//Superman walk & flying movements
fly = "off";
_root.onEnterframe = function() {
if (Key.isDown(70)) {
_root.superman_mc.gotoAndPlay(4);
_root.superman_mc._y -= 17;
fly = "on";
}
if (_root.superman_mc, hitTest(_root.right_mc)) {
_root.superman_mc._x = 700;
}
//moves superman right
if (Key.isDown(39) & fly == "off") {
_root.superman_mc.gotoAndPlay(3);
_root.superman_mc._x += 17;
_root.level1_mc._x -= 17;
direction = "center";
//makes superman face foward
} else if (direction == "center") {
_root.superman_mc.gotoAndStop(1);
}
//moves superman left
if (Key.isDown(37) & fly == "off") {
_root.superman_mc.gotoAndPlay(2);
_root.superman_mc._x -= 17;
_root.level1_mc._x += 17;
direction = "left";
} else if (direction == "left") {
_root.superman_mc.gotoAndStop(1);
}
};
whats happening is that the background keeps going but since i have it setup to move along with superman .. if anyone can help thank you alot..
-rob-
Keeping Character On Stage Plus Keeping Moving Background With Character On Stage
Im in the process of creating a superman game.. and i right now have him in walking mode .. i created him which is superman_mc . which has his waking animations etc.. inside and i have created a background mc which is level1_mc which basicly moves along with superman as he walks. .the problem i am getting is keeping the back ground from moving off the stage and superman from going off the stage i can keep superman on the stage and in one place on the stage with the code i have now but the background still moves off.. here is the code i have :
stop();
//Superman walk & flying movements
fly = "off";
_root.onEnterframe = function() {
if (Key.isDown(70)) {
_root.superman_mc.gotoAndPlay(4);
_root.superman_mc._y -= 17;
fly = "on";
}
if (_root.superman_mc, hitTest(_root.right_mc)) {
_root.superman_mc._x = 700;
}
//moves superman right
if (Key.isDown(39) & fly == "off") {
_root.superman_mc.gotoAndPlay(3);
_root.superman_mc._x += 17;
_root.level1_mc._x -= 17;
direction = "center";
//makes superman face foward
} else if (direction == "center") {
_root.superman_mc.gotoAndStop(1);
}
//moves superman left
if (Key.isDown(37) & fly == "off") {
_root.superman_mc.gotoAndPlay(2);
_root.superman_mc._x -= 17;
_root.level1_mc._x += 17;
direction = "left";
} else if (direction == "left") {
_root.superman_mc.gotoAndStop(1);
}
};
whats happening is that the background keeps going but since i have it setup to move along with superman .. if anyone can help thank you alot..
-rob-
Guide Layer Under A Mask Layer
I can't seem to get a guide layer to exist under a mask layer.
I'm sure there's some workaround, or I'm just screwing up. Does anyone know what I'm talking about?
Thanks in advance for any help.
Mat
Guided Layer AND Mask Layer?
Is it possible to have a guided layer also be a mask layer?
I have a "trail" that I would like to appear so I want to have the mask guided so it will show the trail.
Any comments, suggestions, or tips are appreciated.
- Stephanie
Transparent Layer Visible Over One Layer
Hello everyone. Just abit stumped about a problem I'm having. I'm trying to animate a transparent shadow passing over a layer, but I want it visible only on that layer. I don't want it visible on any layers beneath the one I want affected, is this possible?
Copy Layer Contents To 2nd Layer
Hi all,
I'm loading a few external .swfs as backgrounds, the swf in the background changes on each click of a button in the main swf.
But the backgrounds are kinda big and slow to load, so whenever a new one loads, theres a second of blank canvas showing (or the layer below the one that's accepting the loaded .swfs), then the next pic takes its place.
Is there a way so that when a new .swf loads, it also gets copied to the layer below it? So when another swf loads, and theres that pause of no swfs, it just shows the bottom-most layer which is holding the copied swf that loaded just before?
Moving Objects From Layer To Layer
Yes I knwo this is probably a very naive question but I'm learning Flash 8 here and it says nothing in the documentation about moving an object from one to layer to another. I'm sure in Flash 5 you selected the object and then simply clicked the layer which you wanted it on. This seems to have changed and Adobe/MM have forgotten to say how you do it now.
One Masked Layer And More Than One Mask Layer?
Hi all,
is there a way to get a layer masked by more than one mask layer?
I'm creating an animation where a mask will discover step-by-step the
bottom layer.
But the bottom layer is really complex so I created 5 more layer and
applyed the 'mask' property to them.
The problem is that only the first mask layer is applied on the movie,
while other mask layer are ignored.
Is there a solution to this problem?
TIA
tony
How Can I Duplicate Motion From Layer 2 Layer
If I take the time to create motion on layer one with the word "Hello", and now I want the same motion as that layer EXCEPT I want the word to say "World" when I copy the motion to a new layer it has the word Hello, I then edit that word to say world BUT it changes both layes (object) to the word World. I am trying to create several similar steps of animation kind of like a slideshow and simply want to change the words on the second slide, in effect saving time (hopefully). Is there a way to do this, or do I simply have to do every thing by hand each time?
Thanks!
Bob
Right Clicks
Anyone got an actionscript that disables right clicks and certain keys? working on a lil cartoon.
Why 2 Clicks?
Hi everyone, I'm running into an interesting problem.
I want to resize an image, but there is a problem when the movie is run. It takes 2 clicks of the button, not just one, to aquire the dynamic image size.
here is the link to the movie:
http://www.athenianvp.com/gb/flash/holders-2click.swf
and here is the code:
on (release) {
holder.loadMovie("night.jpg");
oldWidth=getProperty(holder,_width);
oldHeight = getProperty(holder,_height);
d.text="HolderW= "+oldWidth +" HolderH= "+oldHeight;
w = mov1._width;
h = mov1._height;
w1=((oldWidth/w)*100);
h1=((oldHeight/h)*100);
d1.text="mov1.W= "+w+" mov1.H= "+h;
d3.text="w1= "+w1+" h1= "+h1;
does anyone know why it takes 2 clicks to get the values for oldWidth and oldHeight?? my only guess is that the image doesn't have time to load before the rest of the code is processed, but somehow i would figure that the software is smarter than me.
Thanks again,
wetodit
Need 2 Clicks?
Help! I can't figure this out. When you click on the PRINT button once, nothing happens. When you click it a second time, the correct action plays (the HISPANIC button drops and the submenu opens up). What's up with this???
Thanks!
Caren
Clicks Per Second
i need a fla file that shows the clicks per second some one is getting. any help?
Two Clicks When I Want One.
So I am in the process of building my first flash web site and I am having some issues with buttons. My site is one long movie that I have divided into 5 sections. It plays the first section as you enter the page and stop and waits for the user to click one of the 4 buttons on the menu. When the user clicks a button the video jumps to the corresponding screen. Pretty strait forward stuff. The problem that I am running into is that I have to double click the button to get it to go to the screen if there is animation on it. If it is just still text, I only have to click the button once. So basically one side of my site has to be double clicked and the other single clicked. I know it is not a huge deal but consistency would be nice. Ideally, I would like everything to work with one click. Any suggestions would be great.
Right Clicks, How To Do It?
Hello, I´m trying to do a kind of interactive small game, very simple, the user has to click on the 5 buttons which are correct, within other incorrects, then when found the good ones just go to a frame or scene.
It is hard to explain, so I put a swf showing how it would be, more or less. only the two buttons are working.
Please someone can give a light, how to do or how to start it??
I have NO experience with this kind of thing in Flash
Thanks a lot.
Too Many Clicks To Get URL
I have a scrolling msg which links to a page in our site. For some reason, it's taking two clicks to get into the link, rather than one link (for most people, not all). My client hates this! Can't figure out why this is happening. Can anyone help?
I have an object action on the text. Nothing complicated.
Controlling Layer 0 Via Layer 1
I'm working in multiple layers for a presentation I'm doing... and i've completely forgot how to control the main layer (0) by layer (1).
I basically want a button to unload layer1 (which is working fine), but I want to "gotoAndStop" on layer 0?
Can someone help me with this?
Thanks!
- James
Layer React On Layer
Hello All,
I'm trying to duplicate a movieclip x-times and let them all react on the first layer. They all get instance names from blok0 to blok4. But i can't get this to work. blok0 is now scalling when i press key UP or key DOWN. But the others don't react. Does anyone has a solution for this?
Thanks in advance;
PHP Code:
_root.screenWidth = 550;
_root.screenHeight = 400;
//mc max number
_root.mcNr = 4;
//zoom in out / speed the smaller the faster
_root.speed = 5;
_root.zoomDist = 100/_root.mcNr;
//zoom step
_root.zoomStep = _root.mcNr;
//call function
dupMC();
//function
function dupMC(){
for(i=0;i<=mcNr-1;i++){
duplicateMovieClip(blok, "blok"+i, -i);
_root["blok"+i]._x = _root.screenWidth/2;
_root["blok"+i]._y = _root.screenHeight/2;
_root["blok"+i]._alpha = 50;
//set first lyr
if(i == 0){
_root["blok"+i]._yscale = 100*(_root.screenHeight/_root["blok"+i]._height);
_root["blok"+i]._xscale = _root["blok"+i]._yscale;
//function
_root["blok"+i].onEnterFrame = function() {
if(_root.goUp == true){
//smooth motion zoom in
if(this._xscale < (_root.zoomStep*_root.zoomDist)-1){
this._xscale += ((_root.zoomStep*_root.zoomDist)-this._xscale) / (_root.speed * 1);
this._yscale = this._xscale;
}
else{
_root.goUp == false;
}
}
else if(_root.goDown == true){
//smooth motion zoom out
if(this._xscale > (_root.zoomStep*_root.zoomDist)+1){
this._xscale += ((_root.zoomStep*_root.zoomDist)-this._xscale) / (_root.speed * 1);
this._yscale = this._xscale;
}
else{
_root.goDown == false;
}
}
}
}
//rest lyr react on first;
else{
_root["blok"+i].onEnterFrame = function() {
_root["blok"+i]._xscale = (_root["blokk"+(i-1)]._xscale)-_root.zoomDist;
_root["blok"+i]._yscale = _root["blok"+i]._xscale;
}
}
}
}
Mouse Clicks
I want to be able to have a certain frame load when the user clicks on a 'button' but I don't have On Mouse Event action available when I have the text button selected. How do you I get it to check for a mouse release over the button?
1 Click To 2 Clicks
Is it possible for a mouse event to effect two things at once...I am doing layered buttons. and I want it to activate both of them without having to click twice really quickly.
Rigth Clicks
Anyone have an actionscript that disables the right click in flash. Also one that disable key strokes while flash movie is active. Chad
This is sort of a toughy
Mouse Clicks?
Ok i am aware of mouseDown and MouseUp, but is there anyway to be more specific such as detecting left, middle or right mouse clicks?
Thanks!
Clicks Are Stored?
Hey has any one else come across the problem of clicks being stored??
I've built a scrolling selector (kinda like a slot machine). its simple enough, a display window with a scroll up arrow above and a scroll down arrow below. The selection changes the appearance of a movie clip below. Clicking on the arrows lets you customise a character below. This bit works fine.
BUT
When I click the accept button below.
The timeline races off down the movie ignoring all the stops and condition statements. Its as if the clicks are stored up as "true" values and plugged into all the conditionals. I've been trying to debug this for the last 2 days and I'm absolutly flummmoxed? Any suggestions??
Cheers
Connor
Mouse Clicks
Is there a way to differentiate between a rightclick and a leftclick on the mouse?
Button Needs 2 Clicks....
I'm using this code on a frame:
_root.seventy5.onRollOver = function(){
killMusic.text = ("Vol. 75%");
_root.seventy5.onRollOut = function(){
killMusic.text = ("");
_root.seventy5.onRelease = function(){
mySound.setVolume(75);
}
}
}
Not sure if it's the order or what, cause it works, sort of, but only after one press, move the mouse off and back on and press again, then it works fine. These are buttons, should this frame code be for MC's?
Button Clicks
for some reason I have to double ckick on my buttons for them to go to the go.............. why is this? and how can i change this annoyance?
|