ActionScript 2.0 :: Flash 8 MovieClip Hierarchy OnPress
Sep 23, 2010
I'm trying to make an onPress function for a MC inside a MC and I have figured it will look something like this:
_root.mc1.mc2.onPress = function(){}
It won't work though. What to do? (Now I see, I have that mc2 on the 2nd frame inside mc1... if I put it also on the first frame it works fine, but I don't want it on the first frame).
View 10 Replies
Similar Posts:
Apr 3, 2011
Let's say I am loading a movieclip from a remote url within another movieclip on another server.
This movieclip now needs to load another child movie clip on the same server as itself.
How can it get its own url and not the url of its parent container so as to load this child ? Because if it refers to "child.swf" it will be relative to the super parent container insted of the first server isn't it ? So it will not be able to load the child correctly if all it can get is the url of the parent.
View 1 Replies
Apr 12, 2007
There are a few mc's already on stage that I've attached dynamically to _root. Now I want to take one of them and attach it into some other mc on stage, also attached dynamically. I want to retain the position, width and height of the former mc. Is this possible? some way to manipulate the pointers or addresses? Can I manipulate the ._parent property?
View 2 Replies
Jan 26, 2004
I have a button on my main time line root and I have a movie clip that performs an animation inside that I was wondering why I can't access the movie clip with this code I am using mx 2004 [AS]on (rollover) { _root.document.mc_button.gotoAndPlay("up"); }[/AS]
View 9 Replies
Jan 23, 2011
I have created a simple grid on my canvas.First I defined an empty movieclip (wrapper) for my grid, then I draw lines onto it to make the grid.Now, I want to click on the grid and get the x/y of where I clicked so I can determine where in the grid i am. But my trace in the onPress event does not show.I'm under the impression that my mcGrid has a 0x0 width and height. When I trace the mcGrid._width in the bottom it outputs "0" so maybe that's why it is not working? Here is my code:
ActionScript Code:
_root.createEmptyMovieClip("mcGrid", 1);
for (var i=0; i<12; i++) {
var clipName = "mcHorizontal_"+i;
[code]....
View 0 Replies
Sep 17, 2009
Im trying to drag a movieClip onPress.. works ok until i load an image into the movieClip..
Code: Select allimgBig.onPress = function() {
this.startDrag();
}
imgBig.onRelease = function() {
[Code].....
View 1 Replies
Jan 8, 2007
I am trying to build a drop down menu using fuse kit. I somewhat understand the fuse kit, or the stuff I need to alpha, slide, tween and the whatnots. I have a menu button, (button_mc) press it once and the sub menu appears. Press it again and the sub menu disappears But how do I write the code. So It will work?
button_mc.onPress1 = function() {
Some code that make the menu appear
} button_mc.onPress2 = function() {
Some code that make the menu disappear
View 3 Replies
Sep 22, 2009
I have a scrollBar movieClip inside an interface that is not always responding to the onPress event. Sometimes, it works fine, and sometimes I have to roll off of the scrollBarMC for the cursor to change back to the finger and respond to the onPress event. Other times, it responds more than once to the event on just one click.
I realize that there could be other issues within my interface's code, however, when I trace my function calls they seems to not execute or execute more than once. Has anyone else ever run across such an issue with the movieClip.onPress event? Below is the code for the scrollBar mc. Anyone see something glaring?
[Code]...
View 4 Replies
Jan 21, 2010
So far I have created/hacked about some code for an infinite scrolling menu bar, and am trying to create the rollover and release actions for each menu title. After researching it seemed best that the buttons were made from movies clips as apposed to the 'button' type, but I am not sure if this is the case. The problem I am having is that I am unable to get the Contact movie clip to recognise the onPress or an onRollOver and I am not sure why. The .fla file is available here and this is the code I tried to get it to work.
Code:
_root.scrolling_mc._root.menu_mc._root.contact_mc.onPress = function () {
if(contact_mc.hitTest(_xmouse, _ymouse, true) ) {
trace("Does this button work?!");
}
I also tried:
Code:
_root.scrolling_mc._root.menu_mc._root.contact_mc.onRollOver = function () {
trace("Does this button work?!");
}
I understand I am probably on the wrong tracks with the use of _root. but I need to somehow trigger the nested movieclips.
View 1 Replies
Mar 18, 2006
Lets say I have attached a movieclip from the library according to an array.length and I want to assign an onPress or onRelease on these movieclips attached lets say the length of the array was 4 .. so if I want to assign onRelease to this movieclips how do I do that?
View 8 Replies
Sep 10, 2011
In my FLA file (FLASH-8, AS-2)? in the library I have a movieclip named "mc" which is just one frame and in it specifies a property "price" like this: this.price="three";
In the main scene I have this code:
attachMovie("mc","t1",1)
t1.onPress=function(){trace(t1.price)}; //returns the correct value "three"
trace(t1.price); //returns "undefined"
Why the first trace(t1.price) returns the correct value and the second one returns "undefined"?And how do I make this property available without using onPress? The objective is to output the pictures of a set of movieclips and place the price of each picture under it using a dynamic textfield
View 4 Replies
Apr 16, 2007
I'm having a problem with my following situation: I made a class "Scrollbar" which I can use to create a scrollbar for a certain movieclip.This movieclip extended class (Scrollbar) has 3 movieclips (see code below):1 - which has the complete scrollbar1.1 - which has the background for the scrollbar.1.2 - which has the slider for the scrollbarNow, I'm trying to make an onPress handler inside my class, I tried to override the onPress() handler of the MovieClip class but it doesn't work.[code]
View 3 Replies
Apr 15, 2011
lets say i have dynamically duplicated movieClips ID's stored in array list. i want to add a onPress event to them. how do i do it?
[Code]...
View 5 Replies
Jan 25, 2012
I have some FLA/SWF assets which are hierarchies of bitmaps.They have timelines which page-flip through different bitmaps.I'd like to scale these assets down in pixel-size, including the bitmaps they're composed of.I'm not a Flash Animator, but the artist i'm working with doesn't know of an automated way to achieve this. ie, that it's a long a laborious manual process.Does anyone know of a tool which can simplify the re-scaling of bitmap-based FLAs ?
View 1 Replies
Jun 14, 2011
I have searched on the Internet and didn't find any clue on how to do so, any idea ? I don't want flex only flash (my objects are not visual components).
View 3 Replies
Jun 7, 2011
In Actionscript 3 is there any way to determine the precise display object hierarchy an event will traverse through when dispatched from a given object? The object is not necessarily a display object.Although I could imagine this actually being useful somehow, in my particular case it is a learning exercise. I'm trying to master the event system in flash and have some locations where I'm very curious what path an event will take when I dispatch it.
View 2 Replies
Jan 17, 2010
how to do so by clicking on the button movieclip moved to x = 100; and when pressed repeatedly to x =- 150 event onRelease - not work:
[Code]...
View 9 Replies
Nov 5, 2007
[URL]
First, click on the Abaco island shape on the map. You'll see on rollOver there is a glow around the island. Now click on that island and the glow remains for the zoomed-in detailed view. When you return to map and zoom back out, the glow is removed.
Now, compare this with clicking on the island name "Abaco" from the list on the right, instead of clicking directly on the island from the map. It zooms in and shows the details fine, but the glow that should be there is not.
The reason this problem is very perplexing for me, is that the onPress action of the list button in the right column calls the onPress function of the map button. So, theoretically they should do the EXACT same thing when pushed. But clearly they don't.
Here is the code for the button from the list on the right panel:
Code:
listAbaco_mc.onRollOver = function() {
_root.map_mc.abaco_mc.button_btn.onRollOver();
};
[Code]....
There is more code, for example rollOver, rollOut, and Press actions for the other island buttons, but they are all of the exact same format as the Abaco island button and they all have the same problem.
So, to recap, the problem is that the list button in the right panel do not function properly onPress, even though they are calling the onPress function of the island buttons directly, and the island button onPress function works perfectly. Strangely, all but one little thing works. So it's obviously getting to the correct functions and going through the code as planned, yet that one part about the glow is being ignored or otherwise messed up.
View 12 Replies
Apr 4, 2012
I'm trying to do something like this:
var something = "someValue";
some_btn.onPress = function (something) {
someFunction(something);
}
[Code].....
But it traces "undefined". What would be the correct way of achieving this?
View 3 Replies
Jul 17, 2007
I'd like to completely erase an onPress = function() statement.delete movieclip.onPress... and it works because no actions happens when I press that movieclip. But the problem is there's still an on press statement but empty, and I can't make any onpress on the inside movieclips.BTW I still see the hand after using delete mc.onPress even if there are no actions assigned to that event.
View 4 Replies
May 11, 2005
i want to make flash drag a ball onpress and if its onrelease and if its on the Suquare movieclip it should stop draggin.
my code is like this
dynamic class Ball extends MovieClip
{
function onPress()
{
[code]....
View 2 Replies
Feb 15, 2011
I don't understand the "heirarchy" of Flash Output Error Messages. For example: TypeError: Error #1009: Cannot access a property or method of a null object reference.
[Code]...
This error shows when I preview a SWF that calls en external swf. All the code listed in the Error Codes is contained in the external swf. In the TypeError -- where do I look for the problem code? bBrand_Gallery is a class description for the externally called swf. The externally called swf runs fine by itself. All functions in the package are declared as public functions. I know that the null object reference means that it's looking for the property of an object that is not yet instantiated. How do I find that object? Would it most likely be a variable that is not delacred publicly?
I believe the ArgumentError has to do with the fact that the DisplayObject in question is not "created" by the function startShow which includes the removeChild statement. How do I resolve that issue?? Is there a reference as to the best way to interpret these error messages?
View 3 Replies
Dec 22, 2004
I`m working on a presentation template....Powerpoint really sucks! I`m gettin along ok, with fullscreen, presentation mode etc. However, the classic click and goto next slide aint working so good. yet. I`ve been trying to set som sort of action: onPress.Nextframe but it is not working. Also, I`m trying to create the reverse fx, let`s say when I hold down shift (for example) and then click - the "presentation" should play backwards.
View 4 Replies
May 1, 2009
I've created some classes for a nav menu and I'm having some trouble dealing with the click. The bottom class of the chain gets the click, but I need to pass that event up a hierarchy of classes to the very top so it can get handled.My hierarchy looks something like this:
AllMenus
- MenuBar
- - MenuItem
[code]....
View 2 Replies
Oct 3, 2009
I have
level 1: <Element>
level 2: <a>some content</a>
</Element>
<a> is nested in <Element> and I need to delete <Element> without deleting <a>. So basically I want <a> to be the parent element of itself.
Like this:
level 1: <a>some content</a>
View 2 Replies
Aug 29, 2011
Where do I place a function, at the lowest level, so I can call it from any other container above it? For example, I have 3 frames and they all need to use the same function, called "myFunction()". Do I really have to create it in each frame? There has so be a lowe level where this can be placed? Is there a good simple description of AS3 Hierarchy somewhere? Also, how do you specify global variables in AS3?
View 2 Replies
Jun 9, 2010
I'm currently working on a tower defense game and am in kind of an odd situation. I've programmed it in such a way that a large class hierarchy is in place. It's like this StartScreen class ---> BaseLevel class ---> GUI class ---> TowerPlacer class(towers are stored in an array in this class) ----> etc.My problem is that i need to access an array in BaseLevel from my GUI class, is there any fancy trick for doing this? or have i screwed myself over.
View 2 Replies
Aug 26, 2009
I have a menubar as such:
Code:
<?xml version="1.0" encoding="utf-8"?>
<root>
<node label="Road">
<node label="Madone">
<node label="Madone 4.5"/>
<node label="Madone 4.5 WSD"/>
[Code] .....
When I click on a menuitem, I wish to print out the selected item, but in the form of (for example if I were to click Madone 4.5) "Road > Madone > Madone 4.5".
View 1 Replies
Jan 20, 2010
To give a brief background of what's going on here.I am building a personal site where I have a navigation, and I have other subnavs inside of certain pages.Such as if I go to "work" inside of work i have "motion", "web" & "print".Here is some example code of one button on the navigation:
nav_mc.personalbtn_mc.addEventListener(MouseEvent.CLICK, buttonClick2);
function buttonClick2(event:MouseEvent):void {
gotoAndStop("personal");[code]...
It seems to me that actionscript will not read all the way down to the bottom when looking for objects.For example: The first if statement where it's asking if workss_mc exists or not, that will work if it's at the top, but if I move it down to the bottom it will not work.
View 33 Replies
Feb 24, 2010
I have two components being absolutely positioned within a container (they are MapSymbols on an ILOG Elixir map, if that helps). Each component is a VBox with an Image and a Label. Images have functionality tied to the Click event; labels do not.
The problem is when 2 items are positioned so that the label of one is above the icon of another in the z-index, so that the label eats any mouseOver and mouseDown events. Bubbling doesn't help since it bubbles from the label to the vbox to the container, never hitting the lower element. I can't set the vbox to mouseChildren="false", since that keeps the image from getting clicked, as well.[code]...
View 2 Replies