ActionScript 2.0 :: Create Clickable Items In Another Object?

Jul 6, 2010

Alright I'm pretty sure I know what my problem is, but not sure how to fix it. I created a 50x50 grid of objects I want to be individually clickable using the following code to generate them:

[Code]...

I'm assuming this should work except for one issue, the above code is within another object that I have set to be able to clickdrag (so you can drag the whole map at once). Because of this, using "this.onMouseDown" seems to apply to the entire mapObject and gets the depth for each of the 2,000 some odd objects I've created. How do I set it up so that if I click on a nodeObject it gets the depth for just that and assigns it to a variable?

View 1 Replies


Similar Posts:


How To Make Menu Items Clickable

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

ActionScript 1/2 :: Adding Alert Boxes To Movie Items With Clickable Links?

Sep 1, 2009

I currently have a movie where I have an icon (image) and a block of text as a clickable button (locked together) the button takes you to a specific urlActionScript
Code:
on(release){
geturl("[URL]");
}

What I need to do is replace the geturl with some script that will add an alert box with 2 options. I would like the box to have a title something like "Where would you like to go from here?" then two text links "Members Excel" (which will take them to members-excel-forum) and "Newsgroup Excel" (which will take them to newsgroup-excel-forum), like I said I have many more to add but once I have the code and a "How to" I should be able to adapt it.I will have to do this for each of the items (I'll have to unlock them first) there are 24 items in my movie (it looks like 12 as there is an icon and text locked together for each category) so I need to do this for 16 of them, I say Alert box as this won't be bothered by a pop up blocker. The Code [URL]

View 3 Replies

IDE :: Create Clickable Areas Inside A Textfield?

Mar 25, 2009

Click here for the demo

I can't figure out how they create clickable buttons around the text that has associated changes. The button even shifts with the text so that it remains in the correct spot as I type in front of it.

View 1 Replies

ActionScript 1/2 :: Buttons Are Clickable Even Under An Object?

Sep 21, 2009

I have a layer of buttons and then on top i have this overlay that fades on at times.While that overlay is there all the buttons under it are still clickable and the cursor still changes to a hand. How can i make the buttons not clickable when there is an object on top of it?

View 1 Replies

Professional :: Child Object Clickable?

Dec 31, 2010

I have added an on click event to a child object which is not always displayed Its pearent object also has on click events. There are two problems.
 
1) Whenever I click on the child object the pearents onclick behavior also runs. I do not want this to happen.
 
2)The child object can be clicked on even if i set its alpha to 0, or set its display property to false or send it to the back of the stage. This means its behavior can be invoked by the user even if it is not visiable I dont want the child object to be clickable when it is not dispayedI dont want the pearent object to be clickable through the child object

View 1 Replies

ActionScript 3.0 :: Clickable Object In Video?

Oct 30, 2009

I would like to make individual object / products/ persons clickable in a video. Coull is an example of such software. Does anybody have knowledge or resources how to do this? Can this be done in FLASH or FLEX. I would like to make a tool which can select certain objects in a movie, follow them and make them clickable.

View 4 Replies

ActionScript 2.0 :: Button Still Clickable Even With Object Is Over It?

Jul 13, 2010

it is in fact MC created with duplicateMovieClip("ButtonTemplate", "Button1", this.getNextHighestDepth()); and on (press) event on it, so it acts as button. On clicking it, it moves playhead to a frame 10 where it should not exist while template button is placed on layer that has frames only 1-5 and it loads a MC that covers it and even has command

_root.coveringMC.swapDepths(_root.getNextHighestDe pth());

I still get "hand cursor" on hovering covered button and is still clickable?

View 5 Replies

ActionScript 2.0 :: Create A Clickable Source From A Movie Clip?

Feb 19, 2003

I'm attempting to create a clickable source from a movie clip so that when the user clicks on the movie clip another movie clip (specifically 'profilecover.swf') loads in a separate area of the screen. I've used the following code...

[Code].....

View 14 Replies

ActionScript 2.0 :: Create Multiple Clickable Area In One Movie Clip?

Nov 17, 2010

I have one button ( 4way road map and car ), inside of the button i have one car image How to set the particular clickable area ( car only ), i don't want to click 4way road or its doing another action or another clickable area. I attached my image, in that image i want click separately only the car.

View 3 Replies

ActionScript 2.0 :: Create Dynamic Empty Movieclips, Position Them, Fill Them, Make Them Clickable?

Feb 21, 2007

I have a movie clip that is dropped onto my main scene, and I have the AS below as the frame's AS.

The concept is simple: Create dynamic empty movieclips, position them, fill them, make them clickable. The code under "//////////////////////////////////////Code below here doesn't work" isn't working. The code worked fine when attempting to do this on my main scene, but I ran across some interface issues that caused me to put them into anorther MC. I understand that I only included the code for the first button, right now I would like to get at least one working.

Code:
for(var i=0; i<=43; i++){
iDepth = i + 200;
this["z_Brickmc_"+i] = this.createEmptyMovieClip("zBrick"+i+"_mc", iDepth);[code].....

View 6 Replies

ActionScript 2.0 :: Create Multiple Items Behind Ui?

Aug 5, 2009

What I'm trying to do is have multiple items appear and go behind the ui with the next one coming under previous one also.

View 0 Replies

ActionScript 3.0 :: Create An Colliding Items?

May 13, 2011

How can I create the objects which push eachother?

View 2 Replies

Flex :: Access Items By Their ID If Create Them Dynamically

Feb 8, 2010

In one area of my application I am creating a display that builds itself with actionscript during a loop. (in my actual app there are A LOT of nested children and my function might be looking for any of those children) In that AS I assign each item an ID, but when I try to access that item by it's id it fails. What gives? and how can I accomplish finding a UI component without having to go through knowing all of it's possible parents? [code]

View 1 Replies

ActionScript 3.0 :: Dynamic Create Items With For Loop

Jan 30, 2007

Well, i have this line of code

Code:
var t1:thumbBack = addChild(new thumbBack(x, y));

And i want to create many thumbBacks with names t1, t2, t3... with a for loop.

I tried something like this, but it doesnt seem to work

Code:
for(i=0; i<8; i++){
var this["t"+i]:thumbBack = addChild(new thumbBack(10 + i*200 , y));
}

View 1 Replies

ActionScript 3.0 :: How To Trace Items Name In Object

Feb 19, 2011

how to display item name in object. I have got object and i would like to get its child but i don`t know name of that item. So i thought that i may trace that name but i don`t know how.

View 1 Replies

ActionScript 3.0 :: Create Drag/drop Shifting Items?

Jan 19, 2010

What would be a good way to create a grid of images in which one can be dragged to a new position and the other images will shift to make room for the image dragged? Looking at making a little program that will reorder an XML file by visually dragging the items to where I want them.

View 0 Replies

ActionScript 3.0 :: Where To Create Array Of Items (Which Class File)

Jan 25, 2012

This is a hard question to phrase and having trouble finding the right search terms. In the last couple of weeks I have been learning AS 3.0 and the fantastic Classes that are cool as heck (not a programmer... well sort of). Everything has been working great and I've grasped the concepts well, but because of my lack of experience I am not sure of the "best" way to do some things. For example where (which "as file" to create an array of characters?)

This is a very simple game:
25 "characters" (character class in Character.as)
All characters have the exact same properties with different values:
charName:int
life:int
strength:int
movement:int
type:String
char_mc:MovieClip (or sprite.. probably mc)

There are 2 types of characters; shipCrew and aliens. The differences between the two is that shipCrew can use various weapons and have unique "names". Aliens don't have names, just a type and they can grow and/or multiply. All of the interaction and basic game play I can handle no problem once I figure out "where" to create my characters and classes and or subclasses. My initial "training experiments" worked well... until I started reading up on "best practices" in coding and realized I had it kind of all mixed up and backwards. My concern is "doing it wrong at the start".

My first stab at this was to create the array of ALL characters in the "main.as" class for the document, then looping the array, creating new character instances on the stage. Since each character has different properties I just created the same array properties for each with a different value. So basically I am "hard coding" all the characters up front "by hand" so to speak with all the properties in the array. Since they were all identical basically, looping the array to "do stuff" was straight forward... for now. The array looks horrible in the code and is hard to "read" but since it's all "static" anyway it doesn't seem to matter... but would still like to "do it right".

Game play is simple because at a basic level each character regardless of what type it is will do the same thing. I would expand on the differences later. However as part of this inquiry I will need class instances on the stage to communicate with each other (like the idea of a registry for this). So my questions are:
Should I create individual as class files for all 25 characters? (icky?)
Or use an array to store the character class objects? A dictionary? A vector?

They all worked, I tried them all. I like arrays better because easier to deal with, but dictionaries look like fun and might be more efficient (only 25 items, how bad could it be?) storing in an object works too. Whatever type of "array thingy" I choose, Which class file do I create the array in? In the "main" document class or the character class itself? In another type of file like an "init" file? Could I create a "custom" file "type" or class... thingy like "CharacterCreator.as"? How about using a registry?

View 5 Replies

Javascript :: HTML Wrapper Div Over Embedded Flash Object Cannot Be "clickable" By JQuery?

May 27, 2010

I've been trying to do as the client requested : redirect to campaign page then to destination page once a customer clicks on the top banner in swf format.If you are using Firefox, Chrome or Safari, I suspect you can reach the destination page.However, if you are using IE or Opera, I doubt it.I think to cause of such a weird problem is:The swf ojbects don't have a link to url, SO I have to hack the theme template file like this :

<div id="header">';
/*
* A quick and dirty way to put some swf into PHP, and rotate among them ...

[code].....

View 2 Replies

ActionScript 3.0 :: Count The Amount Of Items In The XML File And Then Create A For-each Loop

Sep 24, 2009

I have 10 dynamic text fields inside a movieclip, which are populated via an XML file. However, the xml file sometimes has less than 10 items. It never has more than 10. This results in the following error, which is normal. I need the code to count the amount of items in the XML file and then create a for-each loop. I can visualize it, but I don't know how to write it. Basically what I need the code below transformed in to is this... (notice the #'s)

[Code]....

View 3 Replies

ActionScript 3.0 :: Access Library Items - Create The Corresponding Objects Using The Xml Values?

Apr 8, 2009

Assume i have in library 3 items and the linkage names are: _cl_1, _cl_2 and _cl_3. Now i am reading from an xml the values 1,2,3. Or it could be more complex like 2,2,1,3,2,1,2 How can i create the corresponding objects using the xml values?

[Code]...

View 1 Replies

ActionScript 3.0 :: Looping Through Stage And Display Object Items

Aug 7, 2009

Actionscript 3.0 looping through stage and DisplayObject items. I'm trying to convert to Actionscript 3.0 and I'm trying to find out how to loop through Stage objects as well as DisplayObject.
With AS 2.0 - I would only have to do:
for(var i in _root) // or MovieClip, this, etc { trace("i: " + i + " [i]: " + _root.[i]);}

In AS 3.0 I found this equivalent which works w/ some objects:
public function debug_object(o:Object, show_all:Boolean):void {
import flash.utils.*; var def:XML = describeType(o);
var props:XMLList = def..variable.@name; if(show_all)
props += def..accessor.@name;
for each (var prop:String in props) {
trace(prop + ": " + o[prop]); }}
this.showChildren(Stage);

This kind of works but the o[prop] always traces undefined and it's not showing any movieClips on the stage. I would like to be able to have the debug object function be able to take Stage and DisplayObject arguments like such:
this.debug_object(Stage, true);
this.debug_object(flash.display.DisplayObject, true);

View 12 Replies

Flex :: Limit The Number Of Items In The Repeater Object?

May 19, 2010

I'm using a Repeater object in Flex. Would be possible to stop the repeater after 50 iterations.. even if my dataProvider is bigger ?

I want to display only the first 50 items. I'm using MXML to implement the repeater.

View 1 Replies

ActionScript 3.0 :: Rearrange Stage With Items From A Class Object?

Feb 4, 2009

I want to rearrange an item on stage when the visitor changes the browser size. The item is initiated in an external class G94Menu:

ActionScript Code:
public function addItem(item:MenuItem):void
{
item.y = (item.height + _spacing) * _items.length;

[code]....

View 0 Replies

ActionScript 3.0 :: Drag A Group Of Items And Get The Object Information?

Nov 3, 2009

I have a container which is a sprite. In that container I have added several movie clips. Now I am trying to drag that container over the other containers and have them move out of the way for the one being dragged.

so here is how I create the containers:

ActionScript Code:
for ( var x:int; x < _GroupsArray.length; x++) {
//create a container
var tmpGroup:DAILYGroup = _GroupsArray[x];

[Code]....

1. Is there a way that I can get my group object from the target?

2. The container seems to come apart when I drag and drop certain areas. Is there a way to keep the different objects together?

View 2 Replies

ActionScript 3.0 :: Custom Event That Bubbles Up From Items Object

Apr 22, 2007

I'm trying to make a custom event that bubbles up from the Items object in this code to the Main object, and start the changeInfoHandler there. For some reason, it works when I put the dispatchEvent in the Items object inside a handler for a mouse click, but when I try to bypass that and call the function directly, it seems to only work in the scope of the Items object.

Main.as:
Code:
package{
import flash.display.*;
import flash.events.*;
import ChangeEvent;
[SWF(backgroundColor="0xefefef", frameRate='60', width='640', height='480')]
[Code] .....

View 2 Replies

ActionScript 3.0 :: Organize A Menu Of Items Would Be A Dictionary Object Containing All Its Members?

Sep 3, 2011

My project is a visual way to represent a database of information about books. It will be represented as a collection of menus and submenus. From one menu, the user will be able to access another, from the other the third.Each item in a menu has some content, so the menus themselves are not a means to an end (to execute commands), but a goal in themselves. Viewing them, and browsing between them is the essence of the project.

The simplest way to organize a menu of items would be a dictionary object containing all its members.However, it is not really good for a complex set of menus and sub-menus which is a web of information linked between another.

View 1 Replies

ActionScript 3.0 :: Update A List Component Pushing New Items Inside His DataProvider Object?

Dec 4, 2009

I'm trying to update a List component pushing new items inside his DataProvider object.

I've tried with a:
MY_LIST.invalidateList();
MY_LIST.validateNow();

but the list doesn't change, anyone has some suggestions?

View 2 Replies

Actionscript 3 :: Create Event Listener To Execute A Function When Object A Collides With Object B?

Mar 26, 2011

Alright, I've looked online at a bunch of different collision tutorials but they don't explain what I'm looking for. I want object A to hit object B and then execute a function via to a Event listener.

View 1 Replies

Flash :: Using HitTestPoint With Stage Object To Create Object Boundaries

Dec 15, 2011

I'm trying to create a boundary for a player object, controlled with arrow keys, in my game using the main stage's height and width. For example, one test point is at the top edge of the player object's bounding box so that when the player object's head touches the stage's top edge, the player can't move anymore to the north. The player object is manually instantiated to the center of the stage by using the Flash stage editor so it will start at the center before the program starts.The problem is that right at the start of the program, I can no longer move the player object up or down with the arrow keys but I can still move it left or right. The intention is to allow the player to move north until the player object's head touches the top edge of the main stage.[code]

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved