ActionScript 2.0 :: Flash OnClipEvent On Timeline?
Mar 26, 2006i remember there is a actionscript tat u can set on the timeline instead on the movieclip itself - onClipEvent(enterFrame){} what the code for it for the timeline.
View 1 Repliesi remember there is a actionscript tat u can set on the timeline instead on the movieclip itself - onClipEvent(enterFrame){} what the code for it for the timeline.
View 1 RepliesI want to duplicate an MC every 5th second, so I came up with this code:
Code:
i = 100;
p = 0;
onClipEvent(enterFrame){
[Code].....
I know this doesn't work, because onClipEvent only works on buttons or MCs. So the question is: is there an onTimelineEvent or something that'd work on the timeline?
I am working on my school website and I am working on the timeline of my school history, but I got stuck. This is what I wrote:
ActionScript:
onClipEvent (load) {
_x = 0;
_y = 0;
div = 5;
} onClipEvent (enterFrame) {
[Code] .....
The problem is when I click the button again when it is scrolling, the order would mess up...
Here is the swf: [URL]
I'm using the code contains onClipEvent(load) and onClipEvent(enterFrame) and duplicateMovieClip() to make the snowing effect in the 2 first movie-clips but then, i cannot stop them in the next movie-clips. (All of my movie-clips in 1 scene only.)
View 1 RepliesI have 5 image segments on a single PNG file. I am trying to get each of the 5 segments to "fly in" left and right and be revealed inside of a mask. It works, BUT only if I refer to a very old tutorial using onClipEvent, where the ActionScript is placed on the image's MC instance name (messy!). For some reason, I can only get this to work if I publish in Flash 6. Using ActionScript 2.0, I am trying to publish this as a version 8 SWF. Not sure what is deprecated, but onClipEvent seems suspect. I have tried (and failed) using onEnterFrame. The buttons no longer get that PNG to move left and right. It might be easier to see it, than explain what I have going on...
[Code]...
I made a flash movie with different layers, on the first layer i add a action script by pressing F9 stop(); & as it works it stop movie.
now on the next line of the same layer i write this
onClipEvent (mouseUp) {
new_mov.parent.play();
}
But it shows me error that its for movie instance, & if i create a movie & then copy my frames & enter it in the move it said you cant enter symbol inside symbol
I am using the following code to load my flash file, contact a php script and decide what frame to play based on the results. THat is all working fine, the problem is that when the animation starts from Frame 2 - gotoAndPlay(2) - it seems to repeat a few frames over and over until the whole animation is complete.
I have done some reading up and the enterFrame is called many times so I can understand why the problem is there but I don't know how to resolve it. The interesting thing is, when I just use gotoAndPlay(2) in the if loaded section, it all works fine. It's only when it's in the onLoad for the loadVars that causes it to break. Using: Flash CS5 and Actionscript 2.0
[Code]....
I have researched the subject for some time now and still haven't figure it out.I use midas3 library (Midi-actionscript3) to import midi to flash. I get each note-item on a timeline. I get the divisions value (192) and all of the "GET-TEMPO" elements are equal to 81.I tried a lot of combinations to get the actual time of the midi but still no good (timeline*192/60 for example).The reason I know it is not synchronized to the actual time is that when I visualize the notes as simple rectangles in flash - I check if they appear exactly to what the mp3 file plays (I have converted the midi file to this mp3 using simple conversion program)I have read a lot about how all is calculated but still haven't figure out the number I need to use to get it right (timeline * MysteriusConstant = ReaTIME, what is the value of MysteriusConstant? is it really constant? and if not how do I calculate how it is changed?)
View 1 RepliesI'm trying to load XML data after an hitTest but doesn't work the way I'm programming. Here is the source [code]...
View 2 RepliesI have 2 images that I want to swap places on a certain frame in my animation. I've been messing with it for quite sometime now and I can accomplish one of two things. Either the animation goes smoothly and the images don't swap depths or the images swap depths and the animation hangs.
View 6 RepliesI need to have an mc duplicate itself under its own onClipEvent(load) handler. To put it perhaps more clear, something like:
onClipEvent(load) {
//clips duplicate itself
}
I have tried all sorts of combinations of _root.clip.dMC, this.dMC,
I've put together some code to allow the user to rotate a clock hand around the clock by dragging it round. My code isn't working.
Code:
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
arrowDrag = true;
}}
onClipEvent(mouseMove) {
if (arrowDrag == true) {
[Code] .....
I have a file where user chooses xy cordinates which display in text box.... which is workin, but I want to have it only appear inside a box area? ie choose once only inside box area - once outside i want the mouse to behave as normal (no new pointer no xy tracking) not sure what if statement would work ?
onClipEvent (mouseDown) {
duplicateMovieClip("../cue", "cue" add n, n);
setProperty("../cue" add n, _x, getProperty("_level0",_xmouse));
[Code]....
I've this script that works fine:
onClipEvent(mouseDown ){
_root.orange1anm.orange1.play();
}
I've been trying to change it to a rollover instead of a click and nothing seems to work.
This is my AS code:
onClipEvent (enterFrame) {
this._x = Math.random()*2+90;
this._y = Math.random()*2+60;
this._alpha = Math.random()*30+50;
}
It is applied to the movie clip. I am having trouble figuring out how to STOP to action. I want it to stop after 10 seconds. How do I do this?
I am trying to change the images the following calls up. (Using CS4 and AS 2.0)
onClipEvent (load)
{
imageProperties = _root.getCurrentImageName(0);
loadMovie(_root.url + imageProperties.name, this.cont.pic);
[code]....
I get that I could find the image in the directory and just change it out with the same name/pixel size, but I'd also like to add more images to this particular project with the same conditions.
I am just learning Flash. I'm using Flash CS4, However I am using Actionscript 1.0/2.0. I have a main page with just simple buttons, and such. My question is, I need to load a swf within my main page. I have a sqaure in the center of my page that I want to load a swf in. I made a rectangle using the rectangle tool, and converted the rectangle into a symbol so that actions may be placed within it. I want to load a file called News.swf within the rectangle. I can't find any code to do this that doesnt have compiler errors.
I found one code: News.loadMovie("News.swf"); when I put just that in the Actions field, and I export the movie I get the error: Statement must appear within on/onClipEvent handler
I just want to load News.swf in the actions tab within a symbol.
I have two movieclips that determine their frame number by a variable. The problem I'm having, though, is that the frame doesn't change when the variable changes. The original variables are determined in the main timeline (_root.item_slot1= 0;).The following code is contained in the item_slot1 movieClip:[code]So it starts off in frame 1. If I change the original variable to 1, then it will go to frame 2. However, the frame doesn't change when the variable changes, and I have a text box that shows the value of the variable, and it changes to 1 exactly when it's supposed to.I can't zip files, but I have the .fla at URL... if you can get it to download from there.
View 7 RepliesI am using loadmovie to load a separate .swf file into a movie clip which is on my main file time line. Is there anyway I can use Onclipevent () to preload the movie I am loading in?
View 15 RepliesIs there a way to remove an onClipEvent? I'm using onClipEvent(mouseDown) but this has to stop after an other event in the swf...
View 6 RepliesCode:
//this is one of the code pieces I've been trying
scroll_menu.onEnterFrame = function() {
var speed=.5/100;
var xcenter=400;
[code]....
1. If I have a 'fish' drawing, and I want to produce bubbles at its mouth, how will I know where its mouth is through Actionscript?
In general, if I have a complex drawing and I want to identify a single part how do I do that using actionscript? This complex object could be an octopus. Then, how do I locate the arm number 3(an octopus has 8 arms?) of the octopus?
2.How do I exit from onClipEvent() when a condition is met? For eg, in VB I have the exit function but there is no EXIT function in flash 5 from which I can exit whenever a condition is met?
why it isn't working, or what I'm doing wrong to fix it. maybe I have the right script, but the wrong location. I'm also on Flash 8, by the way.example. I have the movie clip labeled "characters" on the main timeline. in that movie clip I have one movie clip titled "boy" and another one titled "girl". the "boy" movie clip is lip-synced and talking up a storm with some audio, and somewhere down the line, "girl" movie clip is introduced and is also supposed to speak on the frame I labeled by the same name, "speak". I'm trying to specifically target a certain frame in her movie clip timeline to play, but I just can't get it right.what I do have is:
onClipEvent (load){
_root.characters.girl.gotoAndPlay("speak");
}
now I know I could also have:
this.gotoAndPlay("speak");
I've tried placing the script directly on the "girl" movieclip when I want the event to happen, and then also placed the script on its own actionscript layer, but somehow, it just isn't working correctly.like I said, "boy" is chatting up a storm, and let's say something like frame 200 is when I want "girl" to come in with her line, that specific audio frame within her movieclip timeline labeled, "speak". she also has about 6 other speaking cues that I'm trying to call up to coincide with movieclip "boy" while he talks.
Why doesn't this code work?
Code:
onClipEvent (enterFrame) {
this._x = this._x+20;
if (this._x>300) {
[code]....
I have a Movie Clip on my time line that has an empty movieclip inside it which I whish to load a random external SWF file into. There is to be an unknown number of SWF's to load in and these are to be played one after the other. So when the first random SWF is finished playing the next random SWF is to start playing.
Here is the hierarchy of my file
Code:
|_ Timeline
|_ plasmaScreen_mc
|_ emptyMovieClip (instance name advert)
So on my empty movie clip I have an onClipEvent which loads in the file path of the External SWF from an XML file and tries to load the extrernal file. Here is my code
Code:
onClipEvent(enterFrame)
{
if(this._currentframe == this._totalframes)
{
[code].....
Unfortunately because the code for getting data from the XML file is included in the onClipEvent "this" now refers to the XML data and not the movieclip. Can anyone tell me how I can proceed. I need to pass the filename to movieclip.
First here is my code:
[Code]...
Simple really. This event handler tells 3 different movie clips to play forwards and backwards depending if the main movie clip has been rolled over. This all works fine... what I can't seem to work out is when the movie clip is clicked I would like this event to stop and become disabled.
I've got this on a movie clip instance and it works great:
[Code]...
What I want to do however, is have "music1" play earlier on in the movie. I have a specific frame that I want it to start playing on. I don't want to wait until this clip loads. I've tried just putting a keyframe on a frame within the main timeline and adding some script but, I can't make it work.
I registered because this forum kept on popping up when I asked google my actionscript questions.
I'll just come right out and admit it, I'm a noob. I am making a website with a bunch of buttons on a menu bar. When you mouse over a button, a submenu of other buttons pops out of it. I use this code.
[Code]...
The parent buttons are movie clips, and the sub-buttons are on later frames.My question is this: how can I delay it so that you have to hold the mouse over the button for a second before the button's playhead goes to its next frame?
Ideally, I'd like to have the playhead go to the second frame immediately, to change the color of the button on mouseover, and then have a delay before frame 3, when the sub-buttons start to appear.
Ok. I have two MCs. One a red ball, another a blue. On the red ball, (ball_mc) I have keyboard movement with the arrow keys. I also have the fallowing code on it:
if(this.hitTest(_root.ball2_mc)){
play();
if(ball_mc._currentframe == 6){
[code].....
I have short script (onClipEvent (enterFrame) {some code here}) that works well on movieClip that is on Stage. I've added the script to 'actions - movie clip' -window). But my problem is that movieclip should be attached dynamically usign actionscript, so I cannot add the script to the clip, as I used to.
View 1 Replies