ActionScript 2.0 :: Define A HitArea Without Creating A New Movieclip?
Nov 1, 2009Is it possible to define a hitArea without creating a new movieclip? I want to define by using xMin, xMax, yMin, yMax.
View 2 RepliesIs it possible to define a hitArea without creating a new movieclip? I want to define by using xMin, xMax, yMin, yMax.
View 2 RepliesI copied this from some other forum because it's explain well "...Let�s say you are loading in an external asset that has an alpha channel, such as a PNG. Now let�s say that you want that asset to act like a button, with rollover and click actions. No problem. No reason you can't do that. But, actually, there is a problem. The hit area for that external asset will be its entire bounding box. Take this octy image for example: Even if you rolled over the top left of the image where it�s totally transparent, it will still trigger rollover actions, which is certainly not ideal and could potentially be very confusing for a user..."
[Code]....
I am trying to set up a cicular movieClip as a hitArea for another, but the circular shape is not detected rather the bounding box of the movieClip. is there any way around it? am i doing something wrong?
Code:
TurretRange_mc.hitArea = TurretActive_mc.TurretHitArea;
TurretRange_mc.hitArea (TurretActive_mc.TurretHitArea);
so far i've tried these two methods.
Is it possible? What I'm trying to do is enlarge the hitArea for a selected movieclip on my stage, but only onRollover. I have 5 MCs on my stage acting as buttons of sorts. onRollover of any of the clips, they grow in scale and I'd like the hitArea to do the same so they (MC and hitArea) are proportional.
View 2 RepliesHow i can define a hit area for my movie clip. i want determine accident of two MovieClips and I need to define a hit are for them.
View 4 RepliesThe below code is working fine when I place my button on main time line... when i place my button inside of any MovieClip, it never work and never attach circle from the library???can any one tell me please what should i need to change, when my Button is inside of MovieClip. Image is loading fine but my loading circle is not visible....
btn_About.addEventListener(MouseEvent.CLICK, Loading_AboutImage);
function Loading_AboutImage(event:MouseEvent):void
{
[code]......
Basically I want to define a variable in a movieclip and then display that in a textbox outside of the movieclip. To be a little more specific I want to make a variable be false and then when a movieclip gets to a certain frame the variable is set to be true. The true will then be displayed in a textbox on the main timeline.
View 2 RepliesIf I create a Movie Clip and assign a child Movie Clip as the hit area using this.hitArea = this.mcClipName; is there a way for me to disable that hit area? For instance, mcButton is a button. When I click mcButton, it triggers a function that reveals other content in my movie. I don't want them to be able to click that button again unless they close the new content (using another button that appears with the new content).
View 3 Repliesis there a way to assign a dynamically created movie clip the hitarea of a PNG file that is loaded into it via actionscript, basically creating a none square/circle hitarea that is a mask of the bitmap image.
View 1 RepliesI am embedding swf files into flex and no matter what button I use, mine or one of the library swf's that comes with Flash, the hitarea shifts upwards to the top 10 pixels of the button and up from there outside the button area.
View 0 RepliesFlash CS4
AS2
RadioButton Component
I want to remove the so called "HitBox/HitArea" on the RadioButton component - I don't want the user to be able to click anywhere else except the button - and I don't want to just resize the hit area so it's as big as the button (the hit area is a square, and my button is a circle)... can this be done? or does the button absolutely depend on hit area? Part of my reason for asking this, is when I publish my .swf with the radiobutton - the hitarea is displaying as a big white rectangle that is covering the button and part of the text up... why is this?
How to programmatically enlarge a flex 3 button's hitArea. Is there some function that I can override? There is no function in the button class called hitArea. What I have done is, I have created a programmaticskin for a button. The form of the skin consists out four arrows. In between the arrows there is nothing (meaning transparent). Because of the way the skin is shaped, it's difficult to click on the button. The skin has alter the buttons hitArea. What I'm looking for is a way to enlarge the hitArea and alter the hitArea shape in to an square. (the hit area must ofcourse still be invisible).
View 4 RepliesI have a grid of many 10x10 pixel squares separated only by a pixel line. When the user rolls over the sprite, it grows, animating to about 4 times its size--to around 40x40 pixels. The sprite stays large while the mouse is over the sprite, but if the user wants to rollover the neighboring sprite it is obscured by this sprite and its larger size.
Is it possible to shrink the size of the hit area so that even though the sprite grows in size the mouse can still access or trigger the neighboring sprites underneath--to the right, left, top, bottom? I thought about using Mouse_move, but wasn't sure if that would fire off too many events.
I read the following posts. However, my hitArea needs to be the same size or just slightly larger than the original 10x10 pixel sprite. I've had little success. [code]...
I am trying to customise a listbox component so that when the user clicks on one of the items a movie clip containing 3 buttons appears. My problem is that as I have make the buttons appear whern the item in the listbox is clicked, they are attached to the movie clip and so dont work.I think that one way around this would be to define a seperate hitArea for the listbox item so that this does not interfere with the buttons when they appear
View 2 RepliesGot this weird issue going on today. The hitarea, the 'interactive space' of some of my buttons is off/ distorted. I created several buttons in a class with the pen tool and converted them to Buttons. I added some eventlisteners, but when I tested my Movie, I noticed the interactive space of some buttons was gone or at a different position or not the size I made it.
I made another button using the rectangle tool, and tested again. I noticed the visual button was at the place I put it, but the 'interactive space' was at the bottom right. Whenever I would move over this interactive space with my cursor, the visual button would instantly go to the place the interactive space is. Whenever I move the mouse out of the interactive space, the visual button goes back to its inital place.
Check it: (press start, 2 times the right arrow, then the window, then go to one of the buildings in the landscape and click on it)[URL].. Here you see two rectangle shape buttons. Hover over them, no interactivity. Move the mouse somewhat down to the right, and weirdness happens.
[Code]...
It transpires that there was another Sprite being create and set to alpha=0 which just happend to be at the same Y position as the height of the SimpleButton. This was preventing interaction with the button.
I have a SimpleButton which I am positioning on the stage. I'm doing a variety of things with it buy when I set it's Y position it breaks/alters the hitArea.
var playUp:Bitmap = getBitmap('play_up');
var playDown:Bitmap = getBitmap('play_down');
var Y:Number = 100;
[Code].....
I have been having some trouble with a movie clip basically designed to act as a button for a store front for a website.This movie clip has, stored as the front of the movie (i.e. before you click in to edit the movie) the following code:
on(rollOver){
gotoAndPlay("Over");
}[code]..........
This gives the movie the hover over and out effect and animates the button so as once pressed the button expands to give a 'Product Details' view.However, when clicked the info shows up as it should but the hit area which I put into the Movie Clip is still on the info area so none of the contents on this new window are accessible and when the cursor leaves the designated info area the movie clip returns to its first stage as it would appear at the start of the animation.Is there any simple way to disable the HitArea on specific frames within a Movie Clip?
I'm creating a menu bar that is a movieclip and inside the movieclip consists of the buttons.Now the menu bar is twice as WIDE as what is visible on the stage.The only part you can see is the text 'menu' on a bar.Then when the mouse hits the bar, it flies across the screen to the otherside of the bar where the menu buttons are.Now the menu bar does its animation over 20 frames - the last frame being the frame where the menu buttons are now visible.
On the last frame i have the 'stop;' code
On the first frame I have this code:
Code:
stop();
this.onEnterFrame = function(){
if(rewind == true){
[code]....
A can't seem to get this creating movieclip thing, or attach movieclip. What I want is when a certain button is pressed, a MC in the library is created on the work area, at the mouse location and will continue to follow the mouse untill it is clicked. Once clicked, it stops dragging, but if clicked again, another MC on the screen will gotoAndStop(2); and so on. I have most of the script idea down. But I can't seem to get the create new MC to work.
View 4 RepliesIv'e got a problem, when creating a movieclip inside a movieclip. I create 5 movieclips dynamically... I want a clickable tag/box on each of these moviclips...
[Code]...
I've created a movieclip using actionscript and the output recognizes the MC, however, I am unable to see it. Here's the code:
[AS]_root.createEmptyMovieClip("scroller", this)
_root.scroller.beginFill(0x00FF33, 100);
_root.scroller.endFill();
[code].....
[code]will create an instance of the movieclip "levelUp_mc" and play it.I have the same code in a function in a class, but it doesn't do anything. What is going on?
View 2 RepliesI have a script that create and positions a lot of movieclips (almost 2000) in an isometric perspective. These movieclips are in fact each grid of the big isometric movieclip. Okay...The thing is... can I create these grids and positions them and then export it all already created and positioned into and external SWF with all properties or someway to cache this script?I think if I put all movieclips manually and position them manually too... the compilation could be faster and the drag stuff could be faster too.
View 1 RepliesI am making a bar of 4 different movie clip buttons in a row. Like "- - - -" and what happens is when you hover over them they expand and show content of what they are labeled. "info" hover over shows content. But the problem is, whenever let say hover over Contact, The "Info" title on the bar next to it will show. I'm unaware of how to make it so the "Content BOX" is above the rest of the hover links. All the hover links are all into one layer, in a movie clip. (So I can toggle the whole button bar from left to right.)
View 0 Repliesi am creating a frogger game, my problem is how to create a duplicate movieclip which is the car and how to generate it randomly that wont hit or overlap another car...here is my code and .fla
import flash.events.Event;
import flash.display.MovieClip;
stage.scaleMode = StageScaleMode.SHOW_ALL;
[code].....
Is it possible to define the properties of a movieclip by clicking a button and then to play the movieclip by pressing another button.
for example:
clicking on buttonA defines the sizeA of a circle clicking on buttonB defines a second sizeB of the same circle clicking on buttonC makes the circel growing from sizeA to sizeB
this I need for 25 different circles which shoud grow at the same time
I am creating one new empty movieclip like this,this.createEmptyMovieClip("vjn", this.getNextHighestDepth());
vjn.beginFill(0x000066);
vjn.moveTo(150, 50);
vjn.lineTo(50, 250);
vjn.lineTo(250, 250);
vjn.lineTo(150, 50);
vjn.endFill();
these lines are creating only the square corner, but i want rounded corner. How can i increase or decrease the radius size. How to create the rounded corner through script.
Basically when I place multiple items on the stage, each one will have it's own movie clip. The name of the movie clip is stored in a xml file. How do write something along the lines of "itemMC = new xml.items[1].movieClipName"?
PS: Kinda off the topic but what's the datatype of stage?
Say that i have a variable called explosion when this variable is set to yes i'd like it so that whenever you press the screen with the left mouseclick it "creates" a movieclip where you clicked that in the library is named bomb (or duplicate the movieclip from off screen if that is easier)
View 2 RepliesI'm trying to add a custom object to the stage by calling a function like this:
Code:
var effectName:String = new String("Explosion");
var thisObject:MovieClip = //some movie clip class, like an enemy
addFX(effectName, thisObject);
[code]....
How can i turn a string value into a movieclip?