MoviClip.getBounds();
Does anybody has a small sample on how to use moviClip.getBounds(). I've seen this looks like java getBounds, but I haven't had any success trying it.
Thank you.
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-04-2002, 04:59 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Preloading A Moviclip
is there any way to make a preloader for a movie clip within the main movie?
please help
Moviclip Problem
I'm having trouble with a moviclip. The Problem is simple. I have created a movieclip, a "flashlight", that masks an owl in the background.
My problem is I havbe a button that you can click to make the "flashlight" beam thinner.
Hear is the code attached to the button:
//light is the "flashlight"
on (press)
{
level0.light.gotoAndStop("small");
}
I really can't see what's wrong with this code, If somebody does, please help me.
I own Flash Mx 2004 v7.0.1
The file is attached.
Loading MoviClip
I am trying to swap movieclips on mouse click. Either that or load a movieclip in my library into the area of another movieclip on the stage upon mouse click. I can only load an external swf, not one in the library nor on the stage. I am using it for a memory game. Each card randomly selects a picture to be on it, calling it from the library, either that or I attach the picture to the card and invisible areas on the stage load a random card.
I put this code on the invisible Movie and it doesn't work:
onClipEvent(load){
this.attachMovie(card1);
}
I put this on the root frame and it doesn't work:
if (this.onLoad="sucess")
{
_root.obj1.attachMovie(card1);
}
Skew Moviclip
Can anyone tell that how i can skew moviclip using actionscript.
Skewing Moviclip
can anyone tell me that how to skew moviclip using action script.
[as3]please Tell Me How To Get BitmapData For A Moviclip?
Code:
var bmdH1 = new BitmapData(150,128);
bmdH1.draw(bBack);
var bmd = new Bitmap(bmdH1);
I tried doing the following code, where "bBack" is the linkage name of a movieclip in my library. but i am getting the following error:-
Code:
1067: Implicit coercion of a value of type Class to an unrelated type flash.display:IBitmapDrawable.
Any suggestions??
Maintimeline From Moviclip
hi
Ive stopped the main timeline on frame 1 to play a moviclip
and at the end of the movie clip i want to send the main timline to frame two?
gratefull 4 help havent used flash in awhile
Duplicating The Moviclip Using The Name From XML
Hi
Any one can help me!
I am finding the solution of this from many days but I can’t get the exactly what I want.
Here is my requirement
When some enter the data in flash text box that data I want to send it to data base & from database the unique id will be generated and it will come to XML file from that ID I want to duplicate the movieclip & that id should be the name of that movieclip.
If any one can help me then i would be so thank full to them
RAj
Loadmovie Into An Mc, Within A Moviclip
ok on my main scene i have a moviclip called content_mc. Within that movieclip there is another called home_mc. I cant seem to loadmovie within the home_mc?? i put in :
home_mc.loadMovie("home_bio_text.swf");
this code lies within the home_mc clip!
But it will not load my move(
someone plaease help!!!
thnx
sean
Moviclip Position
How do i get the movie clip to point at the direction of the mouse, in the x axis, so if the mouse is on the right of the movie clip the movieclip points to the left, if i am at the left side of the movieclip the movieclip points left
Getting A Moviclip By Instance Name
this is probably an easy question, but I can't seem to find the answer.
I want to change visiability of a movieclip based on a string.
This is what I tried, and this does not work!
if ("mymovieclip" in this){
//if movieclip exists, do stuff
var instance = this+".mymovieclip";
instance.visible = true;
}
Comment please
Duplicating The Moviclip Using The Name From XML
Posteddocument.write(''+ myTimeZone('Thu, 10 Jan 2008 07:09:40 GMT-0800', '01-10-08 10:09 AM')+''); 01-10-08 10:09 AM 01-10-08 10:09 AM Hi
Any one can help me!
I am finding the solution of this from many days but I can’t get the exactly what I want.
Here is my requirement
When some enter the data in flash text box that data I want to send it to data base & from database the unique id will be generated and it will come to XML file from that ID I want to duplicate the movieclip & that id should be the name of that movieclip.
If any one can help me then i would be so thank full to them
RAj
Moviclip Slider
Hi
I would like to move my movieclip from left to right, depending where my cursor pointing?
it seems like it should be the simplest of tasks, sense alot of pages has one of those.
http://www.nicbrunson.com/ something like that, witch easing in and out and stoping when reaches the end!
it would be awsome if I could get some help!
(post the same in CS3 forum but im not sure where it belong)
Loadmovie Into An Mc, Within A Moviclip
ok on my main scene i have a moviclip called content_mc. Within that movieclip there is another called home_mc. I cant seem to loadmovie within the home_mc?? i put in :
home_mc.loadMovie("home_bio_text.swf");
this code lies within the home_mc clip!
But it will not load my move(
someone plaease help!!!
thnx
sean
Loadmovie Within A Moviclip?
ok on my main scene i have a moviclip called content_mc. Within that movieclip there is another called home_mc. I cant seem to loadmovie within the home_mc?? i put in :
home_mc.loadMovie("home_bio_text.swf");
this code lies within the home_mc clip!
But it will not load my move(
someone plaease help!!!
thnx
sean
Loading Variables Into A Moviclip
Hi
I would like to load some dynamic text into a moviclip... but Im not sure how...
Example> in my scene input, I have a movieclip called NiceText_MC
In this moviclip I have a dynamic text I want to change(text.txt)..
In the text.txt I have added some strings: b=bread&c=carrot
I added a b in the "var" on the dynamic text string
I have tried with loadVariablesNum("c:text.txt", 0); Both inside the clip and also in the scene, but nothing happens...
Do I have to add some kind of code that tells the variable that it is inside a movieclip?..arghh. ..
thanks
Nooby Moviclip Question
Hi, on my first frame in my movie i have a movie clip, the movie stops at this point so you can see the movieclip, but after the movieclip is done i want to go to another frame in my movie. Please help, thanks in advance.
Ending A Moviclip Before Going To The Next Frame
i am building a site, each page is going to be a movie clip.one frame will be one page in the main timeline, so there will be buttens and such in the movie clip. i am going to put a menu in the main timeline to move from page to page, but to keep it more animated i want to make an animated ending to the page. i want it to tell the movie clip to go to a certain frame and play the ending and then i want it to move to the next page when the animated ending is done.
Why Don't On(press) Have An Effect On A Moviclip
I'm trying to make a easy small game ,where i try to shoot a boat ,whith a crosshair who is connected to the mousepointer......
So i got a question.......
Where is my hitarea on the movieclip?
Have a movieclip a hitarea at all?(i thought it was the shape behind,but it is not)
Is it immpossible to do something like this with a movieclip?
.txt File Loded In To A Moviclip
Hello...
I'm having a problem loading an text file (.txt) file into my swf. I can do it if it is placed on the root but as soon as I try to place it in an moviclip it doesnt work. What am I suppose to do when I want it to load in a moviclip???
Im using flash MX 2004
Atthacing And Removing Moviclip
Hi:
I have a button inside a movie clip.
This movie clip is on the main stage and timeline.
When I roll on the cursor inside this button inside a movieclip, I use the following code to attach a movie clip:
on (rollOver) {
_root.attachMovie("help", ayuda1, 1);
_root[ayuda1]._x = 17.6; // defines the x coordinate
_root[ayuda1]._y = 4.8; // defines the y coordinate
}
I want to remove this athached movie clip on rollout.
I have tried several options but none of them work. I have used:
removeMovieClip(_root._level1);
removeMovieClip(_level0.ayuda1);
removeMovieClip("_level0.ayuda1");
removeMovieClip(_level0._level1.ayuda1);
removeMovieClip("_level0._level1.ayuda1");
removeMovieClip(_level1.ayuda1);
removeMovieClip("_level1.ayuda1");
removeMovieClip(_level1);
removeMovieClip("_level1");
removeMovieClip(_root[ayuda1]);
removeMovieClip(ayuda1);
removeMovieClip("ayuda1");
removeMovieClip(_root.ayuda1);
removeMovieClip("_root.ayuda1");
How can i remove that atached movieclip?
Using Actionscript Inside A Moviclip
I have this actionscript which simiulates a waving flag. Now when I use this script with a .jpg file on the main stage the testing works perfectly. Because i wanted to add a little more to it. ie..adding text ontop of flag without it waving or being masked. I opened a movieclip and inside the movieclip i made the flag movie clip and put the actionscript inside the flag movieclip. However When i did the moveclip acted differently and did not have the waving effect it did onstage. Is there a way i could use the actionscript inside the moveclip so it functions correctly and would then be able to add other elements to the mainstage?
ActionScript Code:
fscommand("allowscale", "false");
Stage.scaleMode = "noScale";
var wave = 20;
var depth = 99;
var flags = [];
MovieClip.prototype.drawBox = function(clr, x, y, w, h) {
this.beginFill(clr, 100);
this.moveTo(x, y);
this.lineTo(x+w, y);
this.lineTo(x+w, y+h);
this.lineTo(x, y+h);
this.lineTo(x, y);
this.endFill();
};
waveFlag.onEnterFrame = function() {
for (var i = wave-1; i>0; --i) { flags[i]._rotation = flags[i-1]._rotation; }
var t = getTimer();
this._rotation = Math.sin(t*.001+Math.cos(t*.0001)*Math.PI*2)*2;
};
_root.createEmptyMovieClip("mask",1);
maskWidth = Math.round(waveFlag._width/wave);
mask.drawBox(0, 0, 0, maskWidth, Stage.height);
mask._x = waveFlag._x;
mask._y = 0;
waveFlag.setMask(mask);
flags[0] = waveFlag;
for (i=1; i<wave; ++i) {
var tempflag = waveFlag.duplicateMovieClip("waveFlag"+i, depth+i*2);
tempflag._x = waveFlag._x;
tempflag._y = waveFlag._y;
var tempmask = mask.duplicateMovieClip("mask"+i, depth+i*2+1);
tempmask._x = waveFlag._x+i*maskWidth;
tempmask._y = 0;
tempflag.setMask(tempmask);
flags[i] = tempflag;
}
How To Convert Moviclip To Jpeg Using AS3
hi to all
i am using flash cs3 and i import images in library and then convert them to movieclip using convert to symbol.
i did some modifications on these movieclips and now i want to reconvert it to jpeg or some welknown image type. but this time i need through action script because i need it to upload at runtime on local server using PHP.
how can i do that?
any positive responce in this regard will be highly appreciated...
Regards
maani
Moviclip Control (if Statements)
Hey guys,
So basically I'm building a site. When you click one of the menu items it
loads the page using the 'with' command.
Example:
About button
with(_root.about){
play();
}
So when you click a button it makes the movieclip play,
then when you click the button again or the close button
the movieclip plays again and it dissapears.
What I am looking for is when you click a different button
if on of the other pages is open it closes then the new one opens
so you dont get the overlapping pages.
I think I need if else statements but have no idea of how to go about it.
My fla file is attached.
Thanks in advance.
Remove Moviclip Function
this is my 5th attempt to get make simple drag & drop function.
i have attached the flash file please go thru it and tell me why the remove movie clip function itsnt working.
this is code on the emty_mc [movie clip on the layer drag] which i want to remove if it is droped on the target[et_ncf ] .
onClipEvent (load) {
this.attachMovie("nt_mc", 'graphic', 1);
clipX = this._x;
clipY = this._y;
}
onClipEvent (mouseDown) {
if (this, hitTest(_root._xmouse, _root._ymouse)) {
this.attachMovie("nts_mc", 'graphic', 1);
this.startDrag();
this.dragging = true;
}
}
onClipEvent (mouseUp) {
stopDrag();
if (eval(_root.empty_mc._droptarget) != _root.et_ncf) {
this.removeMovieClip();
} else {
this.attachMovie("nt_mc", 'graphic', 1);
this._x = clipX;
this._y = clipy;
}
}
Getting A Dynamic Moviclip Width
Hey everyone. I'm running into a little snag with this project I'm working on, and need higher powers to help me work it out.
I'm loading in external images through XML, and am trying to get the width of these images after they load, so that I can place them end to end, using the width as the spacing.
Here is what I have so far:
Code:
for(i=0; i<main.length; i++){
var loadImageListener:Object = new Object();
var imageLoader = _root.createEmptyMovieClip("loader"+i, this.getNextHighestDepth());
imageLoader.addListener(loadImageListener);
imageLoader.loadMovie(main[i].attributes.url);
loadImageListener.onLoadInit = function(){
trace(["loader"+i]._width);
};
imageLoader._y = 225;
imageLoader._x = this["loader"+(i-1)]._x + 490;
};
Any help would be very much appreciated. If you notice in the last line of code I'm using the number 490. I'm wanting to replace that with the width so that the pictures can be any width and they will still line up end to end.
Thanks for all your help.
Moviclip Button Question
Hi, I feel stupid asking this one, but in ways MX is still new to me and even after searching the forum, i cant seem to find the answer, so here goes....
OK, ive got a menu that consists of buttons that are basically text(with up, over and hit set). I needed to do some scripting, so the buttons were then converted to movieclips, and now that they're movieclips, the 'hit area' is basically only any of the text, , despite the fact that the hit areas for the buttons are rectangles the whole length of the text, and the over action doesnt work either (it should change the text to a different color. To give you an example of what i mean, i copied one of the buttons over to this .fla here -- is there a way to get the button to function correctly again yet still being able to use the scripting functions i need to use? Maybe its something so simple, im just not seeing it after staring at the screen for so long, so any help would be much appreciated!!
Jen
Duplicate Moviclip Depth
i used duplicateMovieclip to duplicate a clip a bunch of times. But the duplicates are above everything in the screen, meaning that even stuff placed in layers above the original clip cannot cover the duplicates. Is this because of the depth value in duplicatemovieclip? And how do i draw something so that it can cover the duplicates.
3D Cube With Moviclip Faces
Has anyone seen an interactive 3D object with each face being a movieclip?
Similar to FLAs > Experimental Actionscript > Basic 3D
but with movieclips on each face.
Or is this impossible??
GetBounds
Im busy building a Gannt Chart in Flash.
Im loading variables(_x and duration) into arrays in my movie. A MC duplicates a number of times accoring to the number of tasks and converts the strings to integers.
Then I must access the arrays and find the first value and move it to the relation to the root's _X axis. It's moving it, but in relation to the MC's X-axis.
I was told I must use getBounds to fix this, but it just fries my brain could anybody help?
Code:
-----------------
// Duplicate _root.Task according to number of tasks (numtasks) and moves it
vertmove = 30;
vertcount = 1;
counter = 1;
for (numtasks; counter<=numtasks; counter++) {
duplicateMovieClip (Task, "Task" add counter, counter);
setProperty ("Task"+counter, _y, 50+vertmove*vertcount);
setProperty ("Task"+counter, _width, (this["Task" add counter add "Array"])[1]);
setProperty ("Task"+counter, _x, this["Task" add counter add "Array"][0]);
test = getBounds("Task"+counter);
vertcount++;
}
//test = Background.getBounds(_root);
setProperty (Task, _visible, false);
stop ();
---------------
GetBounds
I've got a movieClip that moves randomly around the stage. I only want it to be able to move in a certain area of the screen. I was trying to use the getBounds property of another movieClip, but didn't seem to work.
Any suggestions
Thanx
Nick
Getbounds
How does this get bounds work and what does it do. Does it sort of ristrict a movie clip or something. Because I have a car game and I want the arrow controled car to only be ristricted to the road, and thought getbounds is what I am after. So could someone tell me how get bounds works, and if its not what I want then how could I restrict the car?
Thanks...
GetBounds
If you would happen to know anything about the getBounds command, I would greatly appreciate your knowledge. I am trying to confine a movie clip to a restricted section of the main scene and when I move my mouse out from over that movie clip I want the movie to stop playing. A perfect example of what I am trying to figure out would be the navigation menu at http://www.celsiusdesign.com
Thanks
[Edited by blindgren on 12-21-2001 at 02:39 AM]
GetBounds Help
i can not seem to make thiswork properly in my game. Sometimes it does not even work at all a second after it just worked. Can anyone give me some insight to help me understand this better?
Getbounds?
how is this done.
I want to make game that has walls that are invisble MC so my hero MC
will not walk through them.
I was told getbounds was the way to go. Thing is i cant seem to figure this out. my games fla is hosted here http://24.98.190.46/beta.fla
GetBounds?
I have a draggable MC on the main stage. I do not want to be able to drag it off of the stage. How do I constrain the boundries?
thx!
GetBounds
I have a game that utilizes get Bounds. When I change my charachters speed variable it runs right over the walls ( or the hit test object)
GetBounds
Hey there,
I attempted to use the getBounds function months ago, and gave up on the project. Now it's come back to haunt me and a friend of mine, and still now, after looking at it and attempting to use it so many times, I cannot figure out exactly how it works.
I've searched up many tutorial sites and forums and I cannot understand how this function works. If anyone can give me a full description of how to use it, I would be really greatful.
I also attached a little example of something I tried just to get it to work, except it isn't working. I don't get why...
Thanks a bunch,
~ Pol
GetBounds - Help
I have a few mc:s that I want to be able to drag. But i don´t want them to be draggable outside a specified mc ( works as the screen )
But I can´t get it work. Now when You press and start drag the mc jump to one of yMin of ramen. Maybe it works when You walk with a character with the arrows but not now. I need help!
-------
kanel.onPress = function(){
this.startDrag(false);
};
kanel.onPress=function(){
burkflytt = _root.kanel.getBounds(_root);
ramen = _root.bakgrund.gul.getBounds(_root);
if(burkflytt.yMax<ramen.yMin){
this._y=ramen.yMax;
}
if(burkflytt.yMin>ramen.yMax){
this._y=ramen.yMin;
}
if(burkflytt.xMax<ramen.xMin){
this._x=ramen.xMax;
}
if(burkflytt.yMin>ramen.yMax){
this._x=ramen.yMin;
}
}
kanel.onRelease = function(){
this.stopDrag();
}
-------
Help With GetBounds
Hey everyone,
I have a problem with the getbounds function at the moment, i have been working on this frustrating scrolling thumbnail page for a while and i stil havent got it worked out, I have a scrolling thumbnail panel that has a invisible movie clip over top called bounds. The scroll panel has code on it that makes the panel stop sliding once the mouse is outside of the "bounds" clip. Anyway this all works fine, but when i load the clip into the main flash file with loadMovie It still works but its really jerky and the release functions on the thumnails doenst work, I have tried refferencing from the root down to the clip but with no luck, Ill add the code so you guys might be able to understand what i mean better.
Thanks
This code is on the first frame of the timeline of this movie, this movie loads into another flash file with loadMovie
#include "lmc_tween.as"
loadMovie("images/24/1.jpg","imageclip");
panel.onRollOver = panelOver;
function panelOver() {
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}
var b = bounds.getBounds(_root);
function scrollPanel() {
if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax){
this.onRollOver = panelOver;
delete this.onEnterFrame;
}
if(panel._x >= 0){
panel._x = 0;
}
if(panel._x <= -32){
panel._x = -32;
}
var xdist = _xmouse - 102.3;
panel._x += -xdist / 5;
}
This is the code that is on the thumnails inside the panel movie clip
on (release){
loadMovie("images/24/2.jpg","_root.containermain.imageclip");
}
as you can see, this movie loads into a movie clip in the main flash file called containermain
GetBounds()
Hello anyone can teach me about getBounds()?
I saw smth like this
mc.getBounds(_root)
????
GetBounds
I am looking for a function that returns width, height, x, y of multiple movieclips.
I am passing an array of names to that function and it returns me all the above information.
Anyone knows how to achieve that?
GetBounds...
hi guys.. i have a little problem here.. which is i don't really get what is the meaning of 'xMin, xMax, yMin and yMax' in getBounds... what are 'these things' refering to? I have a box and I don't get which point the max and min are refering... can somebody explain to me in detail?
GetBounds
hi
i looked in the flash help but couldnt find anything that helped me.
i was wondering if someone could describe getBounds for me and how it works
thanks!
GetBounds() AS 2.0 Vs AS 3.0 Different
AS 2.0 getBounds yields an object with xMin and xMax props that give true pixel bounds.
However AS 3.0 treats the object as having a bounding rectangle and uses that.
Now this is ok until the object is rotated
e.g. take a centered circle, rotate it 45 degrees, getBounds in AS 2.0 will give the xMin and xMax with identical vals
whereas AS 3.0 gives differing values, the square bounding box is wider when rotated
Furthermore the width of the circle changes in AS 3.0 but is constant in AS 2.0
So how do I find the correct pixel bounds of an object, and is this implementation in As 3. correct.
Please note I've tried the .transform.pixelBounds, to no avail
Any ideas, much appreciated?
cheers Steve
GetBounds Help
I wanna to restrict some area in a movie of dragging a movie clip.
eg . if there's a square (or a mazed shaped area) in the movie. a movie clip cannot entered inside the square while dragging.
but it can be dragged rest of the space.
am not familiar with the syntax of using getBounds();
Help With Getbounds
can some one tell me how to stop mc with walls by get bounds?
and explain me how its works?
|