I have 100 buttons, named k1 till k100.I don't want any code inside the button.I need to make the buttons invisible when pressed.I get a currentframe back from something else (example 22) and at that moment I want k22 to be invisible (k22._visible = 0)
I tried: aa = k; bb = 22; cc = k+22; cc._visible = 0;
which controls a component instance, i want to use this code in a button on another swf file, how can i do this?, is posible to use a statement, i do not understand the concept of target path yet.
I'm making a demo project for myself to learn. The project is somewhat similar to "The Story of Stuff" website.But I making this demo and going step by step. I have a small working project but the video clips are embedded and now I'm launching them externally using the flv playback component.I have only made the very first video clip external that is loaded in using the component. The rest of the clips are embedded.
As you can see I made this so when the picture icons appear and when you click on one the video pauses and when you click the close button on the small window that pops up the video resumes.(un-pause)
Basic time line controls. (Linear)
But of course this does not work when I load the clip externally using the flv playback component.My question is , how can I control (Play/Pause) the flv playback instance(s) with my existing icons?
I'm writing a video game and I have used timers all over the place to make everything go. Now I want to be able to pause the game, completely. Meaning, I need to stop and start all timer instances at once, or globally. So I created a Timer subclass called CustomTimer, put some statics in there, came up with the attached code. Now my problem is that I'm pretty sure I've created a memory leak, in that the instances array will just grow and wont allow or gc. So, my question is, is there an "onDestroy()" method or somesuch, that I can override, and use that moment to remove instance refs from the instances array? Or, is there a smarter way to do this? an application object with a pause method perhaps?
I have a movieclip instance named 'placeholder' on the canvas, and I want to change the alpha of the named movieclip from it's class without effecting the alpha of all the movieclips of the same type. How would I specifically target the named movieclip instance that is on the canvas?
For some reason, the same code works now, without any problem at all. I don't know what happened, or why, but I no longer have this problem Here's the original post: To put simply, I created a MovieClip, put it with addChild() to stage, and when I tried to call this piece of code:
I have a button inside a movieclip, to which I would like to apply a rollover function. When rolled over, this button (inside MOVIECLIP 1) would make (MOVIECLIP 2) jump to second frame. I'm using Flash 8.This is turning onto a real headache for me, since i've searched every single forum and thread concerning this matter, and nothing seems to work.
I am trying to make a reference to a movieclip instance that is in another movieclip.
Here's the deal: I have a main timeline for different pages of a website...then within that I make all of the art on each page into a movieclip so I can do animations every time that main timeline frame is called to, yet still keep my main timeline clean.
Within one page's movieclip I have a few buttons that I want to use to go to other pages by referencing them on the main timeline.I have been using this: (home_about is the about us button on my home page, and frame 31 is on the main timeline).
home_about.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_6); function fl_ClickToGoToAndPlayFromFrame_6(event:MouseEvent) :void {[code].............
Since this home_about is within another movieclip,I get the access of undefined property error. Do I need to change the code I've pasted above or add in variable definitions to fix this?
Originally, the client wanted to control "hero_mc" using the keyboard but now they would like to control him with buttons only. Here is the original code on the "hero_mc" which works as expected:
I am trying to create an interactive graphic. Basically, it's three squares layered on top of each other, with a large square in back, a medium square centered in the middle of the large square, and a small square in front centered in the middle of the medium square.
When you roll over the medium square, say, it expands to almost the size of the large square and some text fades in, and the small square on top of it fades away. When you roll off of the medium square, it goes back to it's smaller size, and the small square fades back in.
Currently, I have the actionscript in the movieclip to make the medium square get larger and smaller (and the text fade in), but I need to somehow reference the instance of the small square movieclip to hide it when I roll over the medium movieclip.
My actionscript for the medium square activity, currently:
Does creating a new instance of an Object that uses an identical name to an older instance, delete the previous instance? Or should the original instance be deleted first? The code uses a ridiculous amount of XML vars. Isn't it less memory intensive to parse the XML and save the properties to an Object, and then delete the XML Object, rather than keep the XML Object around and reference it's child nodes directly? Is it better form to break up a huge XML file (>600lines/3200vars) into smaller chunks?
I have got two movieclips on the main timeline. First one is envelope_mc and second is bg_main. In envelope_mc timeline there is a button on 25th frame which plays ahead when clicked.
stop(); on_btn.addEventListener(MouseEvent.CLICK, playAhead); function playAhead(event:MouseEvent):void { play(); }
I have also got some animation on bg_main which I wan't to trigger on 30th frame (inside bg_main timeline) when button is clicked in envelope_mc timeline.
I have 2 movieclips on the main timeline of my movie; One (mc) contains an animation, the other (bt2) contains a button (bt) with code. I want it so when the button (bt) is clicked, it causes the animation (mc) on the main timeline to play.
The button's code is contained inside bt2.
So far I've tried the following things...
Code: bt.addEventListener(MouseEvent.CLICK, onClick); function onClick(event:MouseEvent):void {bt2(root).mc.play();}
[Code].....
... along with several other things. Nothing is working at all, and I spent all last night looking for a solution with none in sight.
I have want to tell a movie instance to play from a class:
`package com { import flash.display.MovieClip; public class Global extends MovieClip
[code]....
pic1m is the class, but I get 1120 undefined property error.If I just put pic1m.play(); in my main timeline action layer it works fine, but I need the function playMask to be global in AS3...
I want to add a new instance of a MovieClip named chair_mc in my .as file but am not sure where to place it. I also want to bring in two other MovieClip symbols but am not sure where to place this. This is the code:
I am trying to get the instance name that i gave to a dynamically created movieclip the movieclip was created using var zebra_mc:Zebra = new Zebra(); //creating a new instance of the zebra class The movieclip was then added to the stage using a for loop, as it was contained in an array. Each time a movieclip is added to the stage it is then added to another array (existingObjects) I then need to iterate through this array and pull out each objects names. I have tried using existingObjects[i].name, which returns "instance140" and existingObjects[i].toString, which returns functionFunction(){}, very useful. and existingObjects[i] which just returns the object.
It seems that my code is problematic, because I assign one instance of a MovieClip to several variables, type MovieClip. The behaviour of others of my codes makes me think, that ActionScript does not make copies of the instance, but references all variables to this single instance. This behaviour now causes trouble.The solution I consider now, is to create copies of the MovieClip and assign them to my variables. Is there any code to copy a MovieClip?
I make several movieclips on the stage so they have names zombie1 zombie2 zombie3 etc. and I was wondering how to I assign a single variable to each of them.. rather than having to create 3 variables. For instance, var zombieHealth would need to be different for each instance, is there an easy way or do I have to create loads of variables in a for loop?
I have problem. I work in Actionscript 3.0. I have add Movie Clip to stage by this code:
for (i=1;i<=33;i++){ var mcPipeShell = new pipeshell(); this.addChild(mcPipeShell); }
my purpos is , after I add 33 instance of movieclip from custom class pipeshell. I want to access to each of them later such as control play head of each movie clip, and access variable entirer movie clips.
the second bit of code "mc_inst1.onRollOver..." works, but the first bit of code, which tries to loop through all movie clip instances, will not work.I think this is because myReference is a String. But can anyone suggest how else I should construct my reference to the instance name?
Code: for (var a:Number = 1; a<myCount; a++) { myReference="mc_inst"+a; var myClip:MovieClip = myReference;
i have a preexisting instance known as gamelevel. When the screen scrolls, gamelevel.x is modified. When the player shoots a projectile, this projectile is not moved along with the screen, because it is simply added using the addChild. How can i add the movieclip, but have it contained within the gamelevel instance?
I have a Movieclip in my .fla which I exported for actionscript. I also have a class in a .as file. I would like to access this Movieclip from within my ass.I have tried this in my class:private var myMC:Test = new Test();addChild(myMC);But I get "1120: Access of undefined property myMC"
I have 2 .as files so far, one for the main game and one for the boulders that come hurdling down the screen. I can get the boulders added to the game fine and the animation is fine too but I don't know how to remove the boulder once it goes offscreen (it just keeps floating downwards) so obviously this is not good since after a few levels, there will be 100's of boulders there wasting CPU cycles and memory space I've tried removeChild and parent.removeChild but neither work
When you're in the flash application, you can watch the properties of an instance. In the properties tab, you can also click "Swap", this will ask you about which instance you would like to use. The original object will now change into another movieclip. So, how do I do this with Action Script?