ActionScript 2.0 :: When Press The Dokimi Movieclip To Call The MakeTree Function This Script Works But Cannot Figure?
Apr 13, 2006I've wrote this code...
Code:
function makeTree(xmlLoad:String) {
import mx.controls.Tree;
[code].....
I've wrote this code...
Code:
function makeTree(xmlLoad:String) {
import mx.controls.Tree;
[code].....
I have a text chat program which let users input text message.
I want them able to input text by pressing 'Enter' key on keyboard.
Code:
if(Key.isDown(Key.ENTER)){
addTextMessage();
}
It has compiled error on AS3. How should I fix it?
enter key press call function AS3 I know this been covered, but for some reason i can not get this to work. I want the enter key to perform the same function as the submit button here.
[Code]....
How do I create an event for the enter key when it's pressed. I am using a textImput, and I want flash to press "submit" when user presses "enter" on the keyboard.
View 3 RepliesIs there anyway of changing an integer of 100, into a 1, 0 and another 0?In context, I've got game with a score. Every time you pick up a coin, it adds 10 to the score, there's 20 coins (so a max score of 200 possible). I've got numbers 0-9 as seperate images. The score currently is a single three digit integer, and I need it to be represented as three single digit integers so I can assign those to an image.
View 4 RepliesI want a function that makes every movieclip on the scene thats beeing released to do what�s in the actonscript.My function doesnt woork, is there a function that works for every movieclip on the scene whatever instancename the movieclip has ?
Code:
movieClip.onRelease = function() {
this._alpha=50;
trace(YEAS);
}
I have load child swf in parent swf, from child swf i am trying to run my parent swffunction I am trying this code
MovieClip(parent).testfun()
but this code is giving error.
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Loader@2b1aa061
[code].....
i've got a function in a movieclip on the main timeline that i need to call when a button in another movieclip is clicked. is there a way to do this in as3?
View 3 RepliesThis is hard to explain, but basically here goes: have a "frame" movieclip that loads images. I call frame.loadImage(the URL) and everything works. So far so good.When I put "frame" inside of another clip, named "frameHolder", then call frameHolder.frame.loadImage, nothing happens.
View 9 RepliesIf I have function_2 nested inside function_1, how would you call function_2 from another movieclip on the same timeline?MovieClip(parent).function_1().function_2()-I know that's incorrect, but just to illustrate.
View 2 RepliesOn my stage is a MovieClip called Box and a MovieClip called InfoBox. InfoBox has a fucntion called setInfo. Box, when clicked (It is a MovieClip, not a button), wants to call the setInfo function of InfoBox.
I tried using the following code in Box:
MovieClip(this.parent).InfoBox.setInfo();
This produced the following error:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@34a8ef99 to flash.display.MovieClip.
at Box/infoBox()
What is proper way to call a function in a sibling MovieClip?
InfoBox.as looks like this:
package {
import flash.display.MovieClip;
public class InfoBox extends MovieClip {
[Code].....
May I know is it possible to call a class function from the timeline of a movieclip? I had tried:
[Code].....
I also have some MovieClips which have their own class and functions.
I am trying to call a function from my main class which is part of a MovieClip.
This MovieClip is on stage. Example [code]...
how do you call a function that is inside another movieclip?Do global functions have to be declared on the root? I'm trying to do a very simple thing, take the grid tutorial and apply it as a mask to an image. Everything works ok, now I would like to call the function that makes the grid after the pic has loaded.
So I have on the root:
mc_picholder
mc_boxholder <---This mc contains the function that makes little boxes
I can assign the mc_boxholder as a mask to the mc_picholder and this works fine. Now say I have a function in mc_boxholder called makeboxes(), and I want to call it from the root once a pic has finished loading into mc_picholder.All the functions to make the boxes are inside the mc_boxholder. I've tried declaring makeboxes as global, and calling it from the root, doesn't work.I've tried tried writing from root: mx_boxholder.makeboxes(), doesn't work either.....
I have a mailTo: function that needs to be added to a button that sits inside of a movieclip. I put the code inside the actionscript layer in the movieclip.[code]...
View 2 RepliesI have to call a function that is defined on the main stage of my project, and I have to call it from a MovieClip
View 3 RepliesWhat I'd like to know is that if I could set up a eventlistener to wait until the MovieClip has reached the final frame, then fire a function.
Solution:
In the last frame of the MovieClip timeline:Code: Select all dispatchEvent(new Event("EventName"));
In the main timeline/class:Code: Select allMovieClip.addEventListener("EventName", FunctionName);
May I know how to call a class function (not a document class) from a movieclip timeline?
View 2 RepliesI have a function defined in my document class that I want to call on a framescript of a movieclip placed on a timeline. Of course, left to itself it's "undefined", and I can't figure out how to reference parent/root/document class.
View 4 RepliesDoes anyone know the best method to trigger a function in the root from a dynamically loaded movieclip (loaded using addchild) using AS3, I understand targeting root is not the best way to do this?
View 2 RepliesIn the following code I am trying to call the function pressMc when movieclip myMC_mc is pressed and the apply the drag action to it. However the drag action is being applied to the whole of level0 and therefore all of the moviclips.I am not sure why. Am using the this key word as I would expect this to be identified as myMC_mc when the myMC_mc.onPress is evoked.I want to write this as a function because I want to apply this drag action to lots of different movieclips
function pressMc (){
delete this.oldX;
delete this.oldY;[code]....
i trying reuse a function many times so i decide to put it inside the timeline and whenever the movieclip move it will call the function, but it dont work. -_-
[Code]...
I have a movie clip with an actions layer. Can I call a function from an actionscript file from the actions panel?
View 2 RepliesI have a movieclip that will rotate by 10 right if the right button is pressed, or 10 left if the left button is pressed.Now, some genius tell me why the right button code works perfectly, but when i press left it doesnt rotate. It moves left, but no rotation to be found .heres the code
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
xspeed -= power;[code].....
how can i call function inside movieclip in library panel it is not on time line
View 2 RepliesI'm having a bit of a hard time with calling a function in the main timeline through a button in a movieclip. The mc is in the main timeline and in it I added a button with this.removeMovieClip(); and so far it works, but when I try to call a function from the main timeline it just doesn't seem to work.
View 13 RepliesI'm having some trouble finishing an interface i'm working on,the function indica() adds a menu listing of items (indicadores) inside a mask because its too large, and i added a scrollbar that allows to scroll through the items but now i need to add the buttons inside the movie clip indicative,i can add symbols and buttons, but i'm having trouble having them call functions inside the same class that the function indica() is running.[code]
View 2 RepliesI have a movieClip named MC, and it's enabled with action script, with the class name MC_Rectangle and a Stage.I override the MC_Rectangle class file in a mc_rectangle.as external file.here is the code:
package{
import flash.display.*;
import flash.events.*;[ code].....
I have new a object in the main stage var
mc_rect:MC_Rectangle = new MC_Rectangle()
in main stage:
1. how can i access the variable "sequence" in "mc_rect"
2. how can i pass parametre from main stage to mc_rect via function setSequence(data:int)?
3. how can i call the function in addSequence() in mc_rect.
in asp.net, i usually use mc_rect.sequenct,mc_rect.setSequence(data), mc_rect.addSequence() to achieve my goals......btw, can function in mc_rect return out result to main stage?
I'm trying to use ExternalInterface.Call to call a JavaScript function to launch a lightbox window. So far I have this:
AS3:
flash.external.ExternalInterface.call("launchLB", "" + aUrl + "");
JavaScript:
function launchLB(url) {
alert(url);
[Code]....
I get the alert but I can't get the lightbox window to display. When my as code makes the ExternalInterface call I get what looks like a page refresh and a blank browser window.
I have an enterFrame action that I use on a graphic:
[Code]....
Because I want to use the above code more than a few times, I tried to make it a function.
[Code]....
But for some reason the function call does not work when I call it via an action on a graphic where initially the code worked when it was explicitly written and not called as a function.
Code:
onClipEvent (enterFrame) {
fadeOut();
}