Getbounds For The Movie Clip With Period (.)
Hi, The getBounds for the movieclips with dots is not working correctly. I am attaching here with the sample. 1) Create an empty rectangle and make to Rectangle_mc2) Attach the follwing code.3) You can see the bounds are showing in the trace window correctly.4) Now replace square_mc1 with square_mc.1Run the code, the bounds will not show in the trace window.What can be done to show bound for movie clips with dot?Thanks In AdvanceAttach Codevar square_mc:MovieClip = miniDwg_mc.createEmptyMovieClip("square_mc1", 1);square_mc._x = 50;square_mc._y = 50;square_mc.beginFill(0xFF0000);square_mc.moveTo(50, 50);square_mc.lineTo(100, 50);square_mc.lineTo(100, 100);square_mc.lineTo(50, 100);square_mc.lineTo(50, 50);square_mc.endFill();//var bounds_obj:Object =square_mc.getBounds(miniDwg_mc);var bounds_obj:Object =miniDwg_mc["square_mc1"].getBounds(miniDwg_mc);for (var i in bounds_obj) { trace(i+" --> "+bounds_obj[i]);}
Adobe > ActionScript 3
Posted on: 04/09/2008 09:01:39 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Load Movie And Then Run It For A Fixed Time Period.
Dear Sir,
I want to run a movie where in there will be three scenes.scene-1,scene-2 and scene-3.The movie will start from scene-1.In scene-1 it will load a movie from c:my documentsflash-1.swf and then it will run for t1 seconds.After t1 seconds it will unload it and the main movie proceeds to scene-2.In scene-2 it will load a movie from c:my documentsflash-2.swf and then it will run for t2 seconds.After t2 seconds it will unload it and will proceed to scene-3 wherein it will load a movie from c:my documentsflash-3.swf and will run it for t3 seconds.After that it will loop again from scene-1.I use swish version 2.Please help me how to write the code.
Thanks
Bera
Making A Movie Clip In A Movie Clip Go To The Next Frame Of The Original Movie Clip
I have a movie clip (for simplicity I'll call it movie_a) in movie_a I have another movie clip movie_b.
in movie_a i have a button that when pressed makes movie_b play (it has a stop frame every once in a while so the button acts as a "next" button)
I want it so that when i get to the last frame of movie_b and press the button, it will go to the next frame of movie_a
I hope that doesn't confuse u and u can help me solve this problem, as i am stumped and I've tried everything I could think of (which isn't that much as I'm not too good with actionscript)
thnx
Fullscreen Period.
i want to go full screen with the adobe air. how do i do this.
im using air because flash player forbids keyboard events on fullscreen. and i cant disable keyboard shortcuts with as either.
Want To Disappear A Swf File After A Certain Period
Hi,
I want to vanish my swf file after a certain time. How can I do it? Let i upload a swf file on 21 Augsut 02 at http://www.a.com, now I want that this swf file will not work or disappear after 23rd of august. how can I do it. Please help.
Thanks
GotoAndPlay After A Set Period Of Time
Would someone be kind enough to tell me how to make my movie restart after a given period of time (e.g. 10000ms).
I realize this simple, but for some reason it escapes me and I haven't been able to find a tutorial that will give me a refresher.
Thanks!
DC
Play Mc For A Period Of Time?
Im using this code to load and unload a movie clip into my scene, I wanted to know if anybody know of a way to set the amount of time this movie clip is present in the scene?
Quote:
this.createEmptyMovieClip("clip", 100);
this.clip.loadMovie("/images/flash/logo.swf");
this.clip.removeMovieClip();
How To Reload Scene After Period Of Inactivity?
I've got a three-scene movie (preloader, intro, main page) in which I want the main page to return to the intro if there is no activity on the main page for 10 minutes.
As a beginner I'm guessing this would entail the SetTimer() function but am unclear how to avail myself of it.
Can anyone help me?
Pause Animation For Period Of Time?
Hey...
I was just wondering if it is possible to stop an animation for a particular period of time, such as 2 minutes, using actionscripting, rather than having to insert 2 mins worth of frames??
haven't been able to find any mention of it...
thanks
jodie_lisette
Concantenation String Using A Period And LoadMovie BIG BUG?
Ok, I think I have a good one.
I've been using this code seversl years. It executes flawlessly when using the attachMovie function. However, when using the loadMovie function (now get this) the "." period in the ".swf" string mysteriously disables and prevent the step/count from executing????????????????????
It took me hours to find the culprit.
How can I concantenate using a period in a "period" in loadMovie action ????
helpppppp!
iaustin
varray = new Array(0,1,2,3,4);
step=0;
function fnext()
{
step ++;// --fstep later
for(i=0; i<=varray.length; i++){
var vpath = "events/popup";//path to file
var ext = ".swf";
if(step=varray[step]){
trace("step= "+step);
loadMovie(vpath+step+ext, "_level300");
//empty_mc.attachMovie(step,"step", 300);
break;
}//loop
}//condition
}//function
Jumping To Frame After Period Of Inactivity
Hello, I am using Flash MX 2004.
I am working on an interactive quiz which will be in a gallery setting. I am trying to find the code that will make it to where the movie jumps to a certain frame (specifically the beginning) if there is a period of inactivity (for example, if it's abandoned in the middle). Does anyone have this code handy?
Thanks!
Execute Function After Time Period
I would like to know what actionscript I need to add to the following code in order for the second function (gotoAndStop) to occur after a three second pause. Thanks.
on (release) {
getURL("http://www.chasingerections.com/ChasingErectionsSmall.mov",_blank);
gotoAndStop(order);
}
Tweening Over A Long Period Of Time?
Hi,
I need help as i just cant workout the best way to go about this:-
I have an object on the left of the screen and I want to get the object to follow a straight path and finish on the right of the screen. Now this seems quite straightforward and i know how to do it in basic terms but here is the thing - How do i get it to take a looooooong time to get from left to right? Lets say something crazy like 8 hours! 8 Hours to get from the left of the screen to the right of the screen.
As crazy as this probably sounds - Is it possible? and if so.....can you please point me in the right direction?
I appreciate your time - Thanks a lot.
Red..
Launching Movies After A Period Of Inactivity
I've a flash file made up of 2 pages. My problem is getting movie to run in each of these pages after a period of inactivity.
The source to my flash files are:
http://www.beatrixnichols.co.uk/aw0501h.fla
(1MB hence not uploaded)
and
http://www.beatrixnichols.co.uk/aw0501h.swf
To begin, after an intro it will stop in a frame on page 1.
(Frame location is: [Scene 1: Layer 1(frame65) / Symbol 57: Layer 1(frame 1) / 506LL: Layer 1(frame 1) / 0033: Layer 3(frame 20) / buttons: Layer 12]
In this frame is a movie clip which I'd like to play if there is no user interaction after 3 seconds. And that movie clip is in the following path
Movie Clip Location: [Scene 1: Layer 1(frame65) / Symbol 57: Layer 1(frame 1) / 506LL: Layer 1(frame 1) / 0033: Layer 3(frame 20) / buttons: Layer 12 / myMC 1]
Additionally another movie I am trying to play after a period of inactivity is on page 2 which is accessible by placing your mouse over the arrow to the right.
The frame location for this is :[Scene 1: Layer 1(frame65) / Symbol 57: Layer 1(frame 1) / 506LL: Layer 1(frame 1) / 00333: Layer 3(frame 1) / buttons: Layer 12]
and the movie I'd like to play after a 3 second period of no interaction is: [Scene 1: Layer 1(frame65) / Symbol 57: Layer 1(frame 1) / 506LL: Layer 1(frame 1) / 00333: Layer 3(frame 1) / buttons: Layer 12 / myMC 2]
I have read about possibly adding a listener to my mouse and using setInterval, so when 3 seconds has elapsed, I'd load my movie. (I couldn't get this working
I'd be really appreciative if I could get an example using the .fla I provided.
ps: I am using flash MX 2004
Thanks
[CS3, Using AS1+2] Pause On Frame For Defined Period
Is there an easy way to do this? I totally misunderstood what setInterval does, thinking it might help.
I need this function to hold on the current frame for defined time in seconds, then goto and play the next frame.
If anyone has a bit of code that does this and doesn't mind sharing it with me that would be great.
Yet Another Trial Period Timer Question
I hope someone here will be kind enough to help me out a bit. I got assigned this today because our flash guy had a car wreck and I'm the only other person here. I don't know much about flash at all. Below is a code snippet and if someone can tell how I've botched things up I'd really appreciate it. Truth is I just grabbed an example from this forum and tried to rework it to meet todays MINIMAL needs until my coworker gets back in a couple of weeks and does it right.
My code starts with the private function Trial about 23 lines down.
/** Constructor **/
function DisplayView(ctr:AbstractController,cfg:Object,fed: Object) {
super(ctr,cfg,fed);
Stage.addListener(this);
itemSize = new Array(config['displaywidth'],config['displayheight']);
thumbSize = new Array(config['displaywidth'],config['displayheight']);
var ref = this;
var tgt = config["clip"];
imageLoader = new ImageLoader(tgt.display.thumb);
imageLoader.onLoadFinished = function() {
ref.thumbSize = new Array(this.targetClip._width,
this.targetClip._height);
ref.scaleClip(tgt.display.thumb,this.targetClip._w idth,
this.targetClip._height);
}
startPos = new Array(tgt._x,tgt._y);
setColorsClicks();
setDimensions();
setTrial();
};
/** Sets up Trial Period, colors, and clicks of all display items. **/
private function setTrial () {
var endMonth=02;
var endDate=05;
var endYear=2008;
var todayate = new Date();
if (today.getFullYear() > endYear) {
Stop();
} else if (today.getMonth() > endMonth) {
Stop();
} else if (today.getMonth() == endMonth) {
if(today.getDate()>endDate) {
Stop();
}
}
}
private function setColorsClicks() { ........ more stuff .........
a New Flash Girl is Meridian darnit ! ! !
Play A MC For A Specific Period Of Time
Im using this code to load and unload a movie clip into my scene, I wanted to know if anybody knows of a way to set the amount of time this movie clip is present in the scene?
Quote:
this.createEmptyMovieClip("clip", 100);
this.clip.loadMovie("/images/flash/logo.swf");
this.clip.removeMovieClip();
Removing Default Timeout Period
Is there any way turn up the default timeout period? It seems fixed on 15 seconds, and I have a loop that needs a little longer to finish. (not a broken while loop) Any help appreciated.
How To Play A Sound For A Specified Period Of Time
Hello all
I am trying to play a sound for a specified period of time. have any of you done this? I noticed there are no params that sound.play() take regarding how far.
I imagine i'll just have to set a timer to do it. If no one has done it (has working code), i'll post something here.
Thanks!
Cycle Through The Scene After A Set Period Of Time
I have a movie that I have next and back buttons to move from one scene to another. What sort of actionscript would I need to add to the timeline to make it "autoplay" or advance to the next scene after a set amount of time if the next and back buttons are not pressed?
I have applied the code below;
var duration:Number = 12000; // set the call delay
var yourInterval:Number = setInterval(doSomething, duration);
function doSomething():Void
{
gotoAndPlay("Scene 2", 1); // play Scene 2 from frame 1
clearInterval(yourInterval); // clear your interval function
} // end of doSomething
The interval time works, but for some reason it only jumps to the first scene,what ever i change the 'gotoAndPlay("Scene *.", *.)' I have 10 scenes in this flash doc.
Does anyone know why, please show me how stupid i being...
my flash doc code
Stage.scaleMode = "noscale";
//below allow to cycle through the scenes.
var duration:Number = 12000; // set the call delay
var yourInterval:Number = setInterval(doSomething, duration);
function doSomething():Void
{
gotoAndPlay("Scene 3", 1); // play Scene 2 from frame 1
clearInterval(yourInterval); // clear your interval function
} // end of doSomething
back_btn.onRelease = function (){
gotoAndStop("Scene 1", 1);
};
next2_btn.onRelease = function (){
gotoAndStop("Scene 3", 1);
};
menu_btn.onRelease = function (){
gotoAndStop("Scene 1", 1);
};
Flash Slow After Idle Period
Background: The flash product is a highly interactive web based program. It contains alot of streaming video and several components that in themselves have large functionality.
Issue: After sitting unattended for a period of time ranging from .5 - 1.5 hours, the programs lags constantly. We know this isnt a streaming issue as the videos can replay and even when they have been cached they are still studdering, it is not just the video that lags, however; the program it self lags in basic animations.
Self Diagnosis: I beleive it is an issue where flash is hogging the system cache.
Question: Is there anyway to clear a system cache dynamically? And / or is this a different problem I am unaware of?
Is There A Command That Executes After A Period Of Inactivity?
I've been searching all over the net for a way to have a webpage go back to a set page after a period of inactivity. Something where if the mouse hasn't moved for say, five minutes, then it automatically goes back to the main page. Is that even possible? Maybe I'm just looking in the wrong place. I'm not sure what exactly you would call it, or what to look for.
Any help would be greatly appreciated. Thank you.
Specter34
Is There A Command That Executes After A Period Of Inactivity?
I've been searching all over the net for a way to have a webpage go back to a set page after a period of inactivity. Something where if the mouse hasn't moved for say, five minutes, then it automatically goes back to the main page. Is that even possible? Maybe I'm just looking in the wrong place. I'm not sure what exactly you would call it, or what to look for.
Any help would be greatly appreciated. Thank you.
Specter34
Displaying Objects For A Set Period Of Time
Hi there,
Was just wondering if anyone knows how to display objects on the stage for a period of time.
What I am doing is creating a Flash (MX) going away card for a work colleague to project on to the wall. I have done the intro and now want to display see-ya messages from other people for about 30secs a message.
The only way I know is to convert the text to a graphic and then work it out using the timeline so each graphic will show for a given period of time.
There must be a way of getting an object to display for a set period within a frame and then for the timeline to move to the next object on the next frame. Something like 'play for 30 and goto frame 2'.
Or am I being silly?
Thanks for your help on this oh wise ones!!!
Get Involved.
Molenski
Pausing Timeline For A Period Of Time
I used to have a small actionscript that would pause the timeline (frame), then start it playing again after a number of miliseconds. (6000) = 6 seconds.
Can I Make A Function Wait For A Period Of Time?
Hey everyone
I just wanted some idea's on how best to tackle this problem in actionscript.
All I want is that when a button is pressed it fades out the current page and then fades in the new page to be displayed. How ever when trying to fade out the current page i doesn't because it goes to the label and starts to play but the next part of the script tells it to go straight to the label to load the new page. Does anyone have a clever way of making it wait till the current page is faded out?
If worse comes to worse can I just make it wait a set period of time before fading in the new page?
Ive attached a bit of the current code and comment it with where the current page is faded out.
Thanks in advance for any help
Gaunt
Attach Code
function homeClick(event:Event):void {
if(prevPage != "home")
{
if(prevPage == "advertising")
{
// Here is where the current page is told to fade out
MovieClip(this.parent).pages_mc.gotoAndPlay("advertisingEnd");
}
else if(prevPage == "websites")
{
// Here is where the current page is told to fade out
MovieClip(this.parent).pages_mc.gotoAndPlay("websitesEnd");
}
MovieClip(this.parent).pages_mc.gotoAndPlay("homeStart");
prevPage = "home";
}
}
Memory Crash After Playing For Extened Period
I'm exporting a fairly large flash file to exe. 16mb to be exact. It contains a complex mapdisplacement script that runs on every other image in the slideshow. The script is conatined in an mc so that when the image disappears so does the script. Or at least that's what I hoped. The script is exectued on mouseMove. After an extened time the computer runs out of memory and cause the exe file to crash. Not real familiar with pc's and have never encountered the problem before. I searched through the forums, no luck, an ideas??
thx
-e
PS I am not deleting the script, but I don't think I should need to.
Text Issues: Missing Character After Period
I don't remember ever seeing this problem before. I tried googling it, but didn't have much success. I typed some text in a graphic symbol, and they all showed up fine when I exported the file, except for the first character after a period. ("...for your business. lease browse through...") - the "P" is missing in what should be "Please" (Yes, I checked and the P is really there in my file).
I'm using static text with "selectable text" on, and the Verdana font. Any idea what happened, and how to fix this?
How To Make Moviclip To Start After A Period Of Time
HI
Being a newbie, this is all stumping me. I have 5 movieclips all on different layers and on the first frame. I want one movieclip to start playing and when this finishes, I then I want another to start after it, and so on. How do I do this? And is this the best method?
Thanks
Hide Error Messages After A Time Period
I have a movie which displays simple error messages in a dynamic text field when you do something wrong. I want to be able to hide the messages after say 8 seconds but I'm not quite sure how to go about doing it. Any ideas?
Movie Clip Buttons Nested Inside Movie Clip Dont Work
Hi people!
im having a problem here.
in my first frame i have a movie clip named "menu_mc".
i have this AS for this movie:
Code:
this.menu_mc.onRollOver = function() {
menu_mc.gotoAndPlay(8);
}
this.menu_mc.onRollOut = function() {
menu_mc.gotoAndStop(7);
}
thats working ok, the menu_mc plays on rollover from frame 8 till frame 12 where stops.
On frame 12 (this is inside the menu_mc movie clip) i have another movie clip, named button1_mc.
and also i have AS controling that MC:
Code:
this.button1_mc.onRelease = function() {
getURL("index.htm", "_self");
}
The problem is that when i rollOver on menu_mc it work fine and the button1 appears, the problem is when i try to click button1...
doesnt work.
the swf you can see it on www.wt.com.mx/menu.swf
can anybody help me please?
what im doing wrong?
or what other ideas can you give me so i can make that work.
thanks!
Mouse Rollover On One Movie Clip Increase Decrease Alpha Of Another Movie Clip..
So I really haven't messed with Actionscript much for a couple years and here is my issue.
I have several movieclips I put together that will eventually be a menu for my website. When you roll over a menu option (movieclip) I am trying to get another movie clip to fade in giving the description of the menu item.
For example - when you roll your mouse over the 'Live Chat' option a brief text description would appear telling you what the live chat is about. This description is a seperate movie clip appearing away from the original menu.
I have made the movieclips for the menu and the movie clips for the descriptions. I tried this action on the menu option to get the description to fade in:
Code:
onClipEvent (load) {
this._parent.mc_text_discussionBoard._alpha = 0;
}
onClipEvent (enterFrame) {
this.onRollOver = function() {
if (this._parent.mc_text_discussionBoard._alpha<100) {
this._parent.mc_text_discussionBoard._alpha += 5;
}
};
}
But the alpha only increases on the description (mc_text_discussionBoard) by 5 when I keep rolling my move over and out and over again. It makes sense why it does that, but I'm not exaclty sure how to get it to continually increase the alpha by 5.
any help would be great and I am anxiously waiting to get this solved!
Kevin
Code 4 MovieClip Button To Load A Movie Clip Into A Placeholder Movie Clip.
Yeah that title sounds a little confusing...so i will explain:
Is there a way to tell a "movie clip button" that once it is clicked on to load a "movie clip" into a "movie clip placeholder". So instead of loading an external swf into the placeholder, it will be a movie clip from within the same library. Putting every single custom clip on the timeline would take a while, so that is why I thought it would be easier like this, and the other movie clips are not that large that I want to load into it so there is no need for external swfs, trying to keep it clean. Here is the code along the lines I am trying to go for.
__________________________________________
this.profile_mc.onRelease = function() {
placeholder_mc.loadMovie("profileSection_mc","plac eholder_mc","_root.content");
}
__________________________________________
- "profile_mc is the button I am trying to activate to load the
"profileSection_mc" into the "placeholder_mc". but so far no good.
- the movie clips are within the same library, not on the timeline or external library.
- Is this possible?
Scripted Movement Over Time Period/frame Length
i'm using this as to move an mc across the screen on the x coordinate:
code:
onClipEvent (load) {
//set initial x pos of clip
this._x = 0;
}
onClipEvent(enterFrame){
//this moves our clip 1 pixel to the right every frame
//up to a certain point
if (this._x<300)
{
this._x+=1;
}
}
I need to adjust this so that the movement takes place over an alotted time period or a defined frame length. Any ideas?
Using A Button In A Movie Clip To Control The Movie(and Not Movie Clip) Timeline
Ok i have a button placed in a movie clip. I want this button, when released, to go in another scene, frame one, on the movie(scene) timeline and not on the movie clip timeline.
So i tried: gotoAndPlay("mission", 1); (mission is the name of my scene)
But it goes to the frame 1 of my movie clip, It would be great if someone could tell me how i can control the movie timeline while my button is in a movie clip
thaks
Vakarm
How To 'stop' A Movie Clip Within A Movie Clip Within A Movie Clip Loop
I've done searches, laughed, cried, and punched holes through the wall, but I can't figure this out.
I'm in Flash MX (pro) and I have a MovieClip on my main timeline (frame 1). Inside that clip is another animation (the static animation scrolling across the screen), and another inside of it of the static animation (6 characters on a train each animated uniquely).
Confused yet? Ha! OK, so I just want the damned animation on the main timeline to run once and then stop (or to 270 frames). I've tried:
myMovieClip.stop()
to no avail. I've tried attaching the script to the movie clip itself, and also to the frame.
Any suggestions?
Telling Flash To Pause For A Period Of Time Then Play In Reverse
Hi! I have a Flash animation that, once it's complete, I want it to freeze on that frame for a period of time (lets say 2 minutes), then I want the Flash animation to play backwards until it reaches the very beginning. Maybe pause again for a short time before playing again. In a sense, I want it to loop back and forth consistently.
I know how I could do this using the frames (basically copy and paste those frames and tell those frames to run in reverse, and make time between them simply by the number of frames between them). But I was specifically asked not to do it that way, and to use code instead. When I've tried to, it will either stop at the last frame or loop from the beginning again.
Thank you so much for your help! This site has been a savior to the Actionscript impaired.
Making A Draggable Movie Clip Control The Location Of Another Movie Clip
http://www.kineticz.net/jba/residental.jpg that is a picture of what i am trying to do. the white bar at the bottom is the draggable movie clip and the group of 3 pictures right above that is the movie clip that i am trying to control w/ the draggable clip. I am having trouble writing a script that will do this. any help you can give will be much appreciated.
|