ActionScript 3.0 :: Clickable/unlcickable Stacked Objects?
Dec 21, 2010
i'm trying to develop a simple isometric flash game using AS3, but i have run into a small problem.
let's say i create a new movieclip (let's call it "ground") for the terrain base hexes (the ones that the character stands on) and populate that with more movieclip objects that represent each of the squares.since i want the game to be mouse-based, i want these hexes/movieclips to be clickable.
now, i will create a new movieclip (let's call it "objects") on top of the previous one that holds all the objects in a given map + your character and all the monsters. i want to do this, because then i can arrange the order (the z-depth) of the sprites according to their position on the map using swapChildren, etc (so that if your character is in a row in front of a tree, he is displayed on top, but if in a row behind the tree, he is displayed behind)
since the trees (or whatever other objects) can have clickable hexes behind them, i don't want them to get in the way of the mouse being able to detect the hexes themselves. the easiest way would be to make them mouseEnabled = false. but that would mean that i also have to make the whole "objects" clip mouseEnabled = false. at the same time if there are monsters inside the same "objects" movieclip i would want them to be clickable (for example to attack them), which means i cannot make "objects" mousEnabled = false.
hence my question. you can only change the depths of movieclips using swapChildren if they are in the same parent container, but you cannot make only part of that container's child movieclips invisible to the mouse. am i understanding something wrong and there is a different way to do this, or is this an actual and un-overcomeable limitation of AS3?
View 3 Replies
Similar Posts:
Jun 29, 2011
I am making a mobile application in Flash Builder 4.5 for android and iOS and am using the itemRenderer and iconitemrenderer classes to make a list of options for my app. For some reason, i cannot make them clickable, or define actions to do when each is clicked. Basically, i'm aiming to use FB's "views", and when an item is clicked, to switch to a new view. Here's the code i'm working with:
[Code]...
View 4 Replies
Jul 30, 2011
I have a Video object which plays a video with an alpha channel. There are objects behind the Video object which I'd like to allow the user to interact with, so if someone mouses over the playing video nothing happens but if they mouse over objects in the background, something happens. Is this possible?
View 3 Replies
Jul 1, 2011
The tutorials on the site are fantastic kudos to the developers of the site and the tutorials. On Creating 3D Carousels would anyone know a way to stack the rings? Also additional images to be called in each new ring via the XML file.
View 1 Replies
Jun 24, 2011
I have a button over the top of an image that performs an action upon rollover. I placed an arrow button over the top of this button to allow the user to scroll through the images, but when I rollover the arrow button it cancels out the rollover underneath it. What I need is for the first rollover action to remain while the user hovers over the arrow. I am using Flash 8, ActionScript 2.
View 1 Replies
Aug 16, 2009
I have a four groups of images which are stacked one above the other. the images which are under the top image won't be seen.I need to drag an image which is on top and drop it on target movieclips(10)I need to validate each target movielcips will contain max 3 images which should be from different groups. No two same groups's images should bedropped on any target, doing so it will go to it's original position.I am facing a problem handling depths of the images/movieclips. Whenever I try to drag an image(placed at the top) the bottom-most image gets dragged. I don't know why is it happening
View 1 Replies
Jul 13, 2009
I want a xml gallery with all the pictures visible and stacked on top eachother. And i also want to make every picture buttons s you can click on a picture and go to the html page with a big picture. is this possible and can someone help me with the code?
View 1 Replies
Aug 6, 2010
I am trying to create a stacked column chart that will show three different values on a column with different colors.
View 1 Replies
Jun 24, 2010
Is there a way with a stacked bar chart to show interleaved sections so each row in the data set could be represented by a separate section of the stacked bar, instead of the chart summing up all the data and combining like data into a single section?
View 0 Replies
Apr 19, 2011
I am using the charting components of Flex to build dynamic charts in Action Script. I'm struggling to get a stacked column set working within a cartesian chart. The chart object and horizontal axis are defined statically within mxml code, and the column set, column series, vertical axis, and other vertical axes, axis renderers, and line/plot series components are all defined dynamically in actionscript.
When I specify my ColumnSet object's type attribute to 'stacked' it renders all the column series data as overlaid instead of stacked. I can specify 'clusterd' dynamically (leaving everything else the same) and it will re-render correctly as clustered, but I've tried several different 'workarounds' to try and force stacked to occur without any luck. The same structure works fine to stack if everything is defined statically in mxml instead of being built dynamically.
Here's a snippet of the MXML definitions:
<mx:CartesianChart id="myColumnChart"
doubleClickEnabled="true"
width="100%"
[code]....
why dynamic construction would act differently than statically defining the chart's series elements, and only when 'stacked' is the column set's type? Is there some magic function call I need to make to get them to stack?
View 0 Replies
Feb 11, 2009
I have some movie clips turned buttons (by way of mc.buttonMode = true and friends) that scroll by an invisible button area, and when they are 'under' that area, none of their mouse events work. How can I still catch their mouse events in addition to the MOUSE_OVER of the invisible button on top?
View 0 Replies
Jun 1, 2009
I want to load multiple images from an xml document into rows, one on top the other on a y axis?
here is my xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<cardRewards>
<rewardImage path="images/redStar1.jpg" />
[Code].....
right now i'm just trying to trace each image name and it's height through the for loop, but what i would like to do is stack each image, 1 following the other.
when i run the trace, the output repeats just the last images name and image height. There is something wrong in my loop, right? Also i should mention that each image has a different height dimension.
View 1 Replies
Apr 13, 2012
I'm making a chart where the x-axis needs to have dates and y-axis names. The lenght of the bar is longer when the date is later. But I want to stack multiple bars on eachother. for example This is the code I have so far
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[code].....
View 1 Replies
Feb 24, 2011
I have noticed that using the "addEventListener" and coming back into a frame, I get multiple events tied to the same component.The design I am using jumps to an "I" frame (intermediate) and then back to the "M" frame (main) when the user performs an action.I add event listeners to several components when I enter that M frame. What I notice is that the events seem to stack up for a particular component.
For instance, if I enter M frame, N number of times and addEventListener("click", handleEvent) to a radio button, I get N calls to handleEvent when the user clicks on the radio button. I guess this kinda makes sense but is not what I want. I just want one event of a particular type (in this case "click") to be associated with the a particular component. I get around this issue by removing the event(s) in the I frame. Then they get reinstalled in the M frame. Only one at a time.
So, just wondering about this behaviour. Is there a way to check for the number of events that are currently active on a particular component? Better way to handle adding events?
View 1 Replies
Jul 10, 2009
I'm obviously a Flash novice. I have a simple movie that I need to modify. On click (or double click) I need to have a web site open in a new window. I am using CS4. I have tried adding a button and associating action script with it. I usually get a message saying that action script cannot be applied to the highlighted object.
View 5 Replies
Nov 23, 2010
Problem is: right on the top of the site, there is a straight line and then with "x" and a round circle as if it's trying to open.
here is the attachment[url]...
Another thing this lightbox doesn't work in IE 8.
View 2 Replies
Jan 9, 2010
My Error was:
1120: Access of undefined property adclicker.
After I was creating a symbol and writing the following code on to the frame:
Code:
adclicker.addEventListener(MouseEvent.CLICK, callLink);
function callLink(event:MouseEvent):void
{
[Code]...
Solution:
I had to change the INSTANCE name to "adclicker" and not only have the symbol with that name!!!
- Choose the button -> Properties -> Instance name: "adclicker".
View 8 Replies
Jul 8, 2010
I have a MC with a hole in it, graphically speaking. I need something behind it to show through the hole. The MC has a button embedded in it, so its clickable. But where the hole is I am not getting the button finger when I play it.My button hit area covers the hole, but it won't recognize it apparently.URL...Its the 2 bluish polygons on the map.
View 1 Replies
Jul 9, 2009
I am having some difficulty creating a SWF file that had a FLV embedded that is completely clickable at any point during the video. Created a new Flash document and imported the video, using the "Progressive download" option. I have tried everything from adding layers with click instances (http://forums.adobe.com/message/256259#256259) to making a button the size of the video that is set at 0% alpha.Every time I either get the video playing that is not clickable or i get the flv icon flashing (no video) that is clickable, or I get the flv icon flashing and it is not clickable at all.I am using CS3 and just looking for a video banner ad.
View 5 Replies
Dec 3, 2009
On website [url].... you will see a big flash screen and on right 4 small flash images in a small box. How do they make small image clickable to another page? Also how do they have square follow image?
View 1 Replies
Nov 1, 2011
I'm using addchild to load an external swf into a swfContainer, but i realize that all the buttons and text links doesnt seem to be working anymore....
///////////////////////
swfContainer.addChild(loader);
////////////////////
I try not loading it into a movieclip instead i load in on stage addChild(loader); and everything works fine and why is that happening?
View 4 Replies
Aug 2, 2010
Is it possible to load a SWF into another blank SWF file and make it clickable? I have a (parent) flash which has a clickable transparent button on it and i am trying to load another external flash into this to make as clickable.
The external loading is working, but its not clickable. Without the external flash, the parent is clickable.
View 1 Replies
Sep 23, 2010
I was sent an swf ad for my website and when I mouseover it I get the click hand symbol but when I click a page loads with an error saying that the page cannot be found.
I tried to place an a href tag around the entire swf file but I get the same error. Is there a way to fix this without having the flash file?
View 1 Replies
Apr 13, 2007
The PHP script below basically returns variables myImage0, myImage1, and so on. I know how to get the variables (URL's) into flash, and I know how to load the jpegs associated with each URL. What I don't know how to do is make each movie clip clickable, and be able to use geturl so that when they are clicked they can go to whatever.
[Code].....
View 1 Replies
Aug 27, 2009
I have a movieclip that sits underneath a mask. I have set up an event listener to listen out for the MouseEvent.MOUSE_DOWN on the movicelip in question but the handler doesn't fire whilst the MC is under the mask.. When I remove the mask everything works fine. So my question is this: Is a MovieClip clickable under a mask? If so - how do you do this?
View 4 Replies
Sep 29, 2011
iam using media display for display video , and media controller for controlling flv video, i want the seek bar to be clickable ,i made the clicking,but how to make the video to jump to the clicked time line. iam editing the mediacontroller.fla in .../en/components/ and coverting it into swc and using it
on(release)
{
var mcli = _parent._tray._xmouse;
[code].....
View 1 Replies
Jul 15, 2002
I was wondering if there was a way to stop a button from being clickable. Lets say the user has been idle on a site for 5 minutes. I want to flash movie to through up a translucent cover on the buttons and make the buttons not clickable.
View 3 Replies
Jun 15, 2009
I'm creating an xml generated gallery/menu, I have the gallery and menu populating fine but my issue arises when I try to make the menu items clickable.
This is inside my populate menu function
_root["mainMenu"+[i]].onRelease = function() {
trace(this);
var splitThis:String = this
var splitThisArray:Array = splitThis.split("Menu");
trace(splitThis)
trace(splitThisArray[1])
};
Now the trace output I get is
_level0.mainMenu1
_level0.mainMenu1
undefined
Although when I set splitThis to "_level0.mainMenu1" manually I get "1" or whatever number comes after "Menu".
View 2 Replies
Jul 29, 2009
So I got this AS3 game thats completely written in Flex without the .fla file and I want to put a clickable button that links back to a webpage to the mainmenu screen.
In the IDE and AS2(which is what I usually work in), it was just simply:
Drag button onto the screen Convert it into a button symbol and then do this:
Code:
on(release)
{
getURL("http://www.urlhere.com",_blank);
}
[Code].....
View 2 Replies
Mar 7, 2011
I created 3 buttons in flash (biography, music, contact). Whenever you hover over them,they animate. Is there a way to make these clickable objects in Dreamweaver? I've searched and found out about the 'invisible button', but this doesn't work for me because it takes away the animation I created.
View 2 Replies