I've got 12 MovieClips, which all have specific functions in the movie. Those MC's will appear and dissappear after a few seconds. But what I want is, that those MC's have to appear at random .If all 12 MC's have appeared, the appearance has to be stopped. So for example MovieClip number 4 has to appear just once. So 12 MC's will appear, but everytime when the movie starts, the appearance has an other sequence.What is written above I want to place in an other MC. So there is one MC which 'load' 12 MC's within it
I have declared two functions to work for one movieclip. The first one start on EnterFrame. The second one should start onRollOver and should pause or end the first one. What is the right notation to do that ?
Even though i know not much of actionscripting, i like to make sites that are flash-based, so i keep on challanging myself with that. But now i stumbled into something, and i just cant find a solition! here is my problem: I have made dropdownmenu's in a movieclip and the mc works with hittest like this:
I'm almost 100% sure that I have to write an if, else statement for this. Below is the code I have for a button(movieclip) I created. It is suppose to play an animation when you click on it. Then when you click it again it's suppose to play a second animation that will take it back to the original state. What is happening is, it goes straight to the clicked state without playing the animation. However when you click the second time it plays the animation that takes you back to the original state. Am I correct in believing the only way to get the animation to play on both clicks is to use an if, else statement.
function clickPlus(event:MouseEvent):void {btn1.gotoAndPlay("clickOpen"); }btn1.addEventListener(MouseEvent.CLICK, clickPlus); function clickX(event:MouseEvent):void {btn1.gotoAndPlay("clickClose"); }btn1.addEventListener(MouseEvent.CLICK, clickX); btn1.removeEventListener(MouseEvent.CLICK, clickPlus);
I just started "coding" in AS3. By "coding", I actually mean trying around with features and generally trying to grasp the vast amount stuff you can do with this software of. I have some coding experience, however the way Flash likes to hide code snippets all over my project does tend to confuse me. Not knowing where I tried putting the code and/or rewrote some other stuff keeps me sorta busy.
Anyway, my issue is this:
Messing around with movieclips inside movieclips, I've keep encountering the error "1120: Access of undefined property onTimerComplete." I do realize that this error generally is caused by not having defined an instance correctly or not having it defined at all - an error beginners tend to make. Nonetheless, I'm not trying to refer to an instance/symbol, I am trying to call a function defined on the stage from within a movieclip that also is placed on the stage.
I've been reading huge amounts of text/articles and how-to 's, but they all seem to only touch the subject lightly or simply going in head-first - becoming far too complicated for me (a beginner) to grasp.
So, trying to sum my questions up into something that looks like a tl;dr:
- What's up with levels, "_root" and referring to functions like in the older versions of flash?
Flash tells me to use some display-package instead of _root, when I use that... (I do realize the article is from Flash 5.0)
- How do you refer to a function defined on the stage, from inside a movieclip? (The function is a timer, that is supposed to make the mother-movieclip continue to the next child-movieclip.)
This has served me well, but I've been designing a new sight and wanted to get more into Action Script to control functions to help improve both my programming and keep my file size down.
So I decided to create an instance of a block (rectangle shape as another movieclip) and have multiple layers. One which controls the actions of two other blocks. The upper most block would not be visable until I ran the cursor over it (increase its Alpha property from 0 to 100 one step at a time in a loop). This would reverse when the cursor ran off (reduce Alpha property from 100 [or less] back to 0 in a loop).
I've read and re-read every flash book I own on the subject and cannot understand why I can't control another instance of a different movieclip.
My question is that I have attached a movie clip using loadMovie() function.Now how do I perform functions on that movieClip such as gotoAndStop().In the sense how do I tell the movieclip to goto a frame?
I have built a movie which has some nested movies within. I have created a class called ButtonMc in a .as file and used linkage to connect the symbol in the .FLA file with the class code in the ButtonMc.as file . This is the code for ButtonMc class:
I made a movieclip with 5 frames inside. Well, outside, when i push a button stop, runs the code: this.movieclip_name.stop(); , but, doesn't stop.Inside these frames there is a enterframe function that call drawing api functions.
I have a virtual on screen keyboard for a touch screen interface. I get the name of the key (Q, W, E, etc) by calling event.currentTarget.name Now each button is a movie clip with a small animation and I need to know which key is pressed so it can call the relevent movieclip..Below is the code:
How do I write my class so it passes all of its functions/methods to the calling movieclip? For example, the following code imports my graphics class and creates a square:
ActionScript Code: import sprites.vectorGraphics; var vGX = new vectorGraphics(); var newSquare = vGX.createVector(this, 'square', 'rectangle', 20, 20, 0xff0000, 1, 0x0000ff, true);
I'm still finding my way around even the simplest things in Actionscript. I have a movieclip named 'leaf9' in which I'm using as a button (which happens to be within another movieclip). I have the following actionscript on the frame which contains 'leaf9':
What I want is for all the other functions to go away once "shrink" has started to play, so that if the mouse goes over the button again, the clip doesn't start playing "rollover" etc etc. So how do I stop all the other functions from playing once the .onRelease function has started?
My problem is pretty simple, but I'm still finding my way around even the simplest things in Actionscript. I have a movieclip named 'leaf9' in which I'm using as a button (which happens to be within another movieclip). I have the following actionscript on the frame which contains 'leaf9':
[Code]...
What I want is for all the other functions to go away once "shrink" has started to play, so that if the mouse goes over the button again, the clip doesn't start playing "rollover" etc etc. So how do I stop all the other functions from playing once the .onRelease function has started?
I have a series of calculations i'm doing over a bunch of objects stored in a array. Each function is pretty CPU demanding but if you only run one function, it just works fine.
I've got a project thats getting a bit big, so Im taking the actionscript out into separate as files. I want all the basic functions to be in BasicFunctions.as and the make a library for more specific functions. I find that a lot of people use the import statement but I cant get that to work with a simple Hello World trace, yet the include statement works fine (see attached). I understand that import/include work differently, but which is the better method? If import, then is that heavier to work with. Any rate, what's the best way to organise code when it gets to the 1000+ lines?
I'm trying to find a way to have global functions in my as project, similar to how flash does with stuff like the util functions (describeType()...), where you can just call the function wherever you need it. For example:
[Code]...
So when I call Test(), it prints out "hello world" fine. My problem comes in that I can't change the name of the Test function, and I can't add any other functions without compiler errors. Is it possible to have a load of global functions in one file, or do I have to split them up into separate files like in the example? Also, I know that I can make a Global class and call static functions like Code: Global.doSomething() but I'd like to know if there's a way to do it as flash does it (describeType(), getDefinitionByName(), etc), or rather, how does flash do it?
I have one function that puts text in a text field and makes a button goto a url onRelease.The code is like this:
Code: item.onRelease = function() { myButton.onRelease = function() { getURL("http://google.com", "_blank"); } talk = this.txt; } the only problem is that the button doesn't work onRelease. i think that it is because there are too many functions there, but at the same time,
Functions embedded inside other functions? In all my years of ActionScript programming, I've never seen this (this is part of legacy code written by someone else which I am adapting):
Its a complicated senario for me. I have a sound management singleton with an asset like dictionary storing all referances to my urls and assets and the guff inside it-
I have a function called addItem(id:String, url:String):Object
I would love to do something similar as soundManager.addItem(id:String, url:String).play() or soundManager.addItem(id:String, url:String).stop() of which it'll both add my item to my dictionary, and begin playing the sound
Let's I have a class Square that has a several functions. I want to call it from a class Grid, which is a group of Squares.So in the class file for Grid, how would I do this:
Code: public function doSquareFunction(thisFunction:Function):void{ square1.thisFunction();
I have a function with 4 necessary arguments (aka parameters) in order to perform the actions. I would like to have the ability to pass the same function to itself as an argument (sort of like a recursive function) along with its arguments. Basically I want to "base" to engage an onMotionFinished event handler if there is another function passed as an argument. Something like...
[Code].....
Would there be a way to use listeners to do this or the AsBroadcaster?
I've tried a couple dozen things to try and stop this movie clip, even down to the bare bones basics and its not working.I have an imported TIFF sequence that i imported onto the stage of a movie clip. Its 73 frames long, i want it to stop on frame 73.So i add the usual stop(); command but it doesn't stop, it keeps looping.On the main layer i put this movieclip in i have an AS layer that also has stop(); and moviclip.stop();But it doesn't stop at all. it just keeps repeating.I put it down to this bare basic setup just to see if i could even stop it. But its not stopping.Layers -> and stuffScene 1Content - movieclipMCActionScript - stop(); movieclipMC.stop();Movieclip - keyframes consisting of image sequence 1-73. frame 73 has stop();
the only problem is that the button doesn't work onRelease. i think that it is because there are too many functions there, but at the same time, i think it's just me..
I have some buttons on a stage that when click change the scale and the position of another movieclip sitting on the stage. All works well but I'd like to make it bit more....cool
Is it possible to tween, maybe with an ease, between the current position and the position when the button is clicked?