Drag Movies Within Root Coordinates.
I have a movieclip within that movieclip I have another movieclip.
I am using the inner movieclip to drag and drop the outer movieclip. I want to set the coordinates to drag to the size of the root movie. So I cant lose to clip from the root.
Cheers
Nathan
ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 03-08-2004, 12:00 PM
View Complete Forum Thread with Replies
Sponsored Links:
Simple Help - Pass Up X Y Coordinates Of Dyn Mc To Root
Hi - I have a series of dynamically created little mcs that are embedded in an swf which is loaded into a root mc.
_root ----
loaded in clip----
dynamic mcs in library
On the root, a function places these dynamic mcs onto the root of the loaded in clip.
When I mouseover the dyn-mcs I want to pass their coordinates up to the _root so that the _root can then use these to attach a label next to the dynamic mc (a tooltip basically). I'm doing it very scrappily at the moment and it looks crap. I've tried to fathom out localToGlobal but I cannot make heads or tails of it.
thanks
frank
View Replies !
View Related
Coordinates Of MC Inside Multiple Conainers, Relative To Root
Hi everyone,
Does anybody know, how to get coordinates of a MovieClip relative to stage(root)? For instance i have a mc on stage at x:100 and y:200, inside mc, i have buttonMC, with x:100, and y:100. Basically the coordinates relative to root would be mc.x + buttonMC.x = 100 and mc.y + buttonMC.y = 300. But if i have like 10s of containers and need to get relative coords? Is there a way to do that?
Thanks in advance.
View Replies !
View Related
Set Drag X/y Coordinates
Hi,
i have a box tab, and when you drag it, i want the rest of the box to come out, but stop at a certain coordinate, and also fixed on some, but i also want it to be a diaganal drag, any ideas?
Also using the drag action now, when i try and use constraint rectangle, when i click n the tab, i automatically jumps to top of page?
View Replies !
View Related
Drag Start Within Coordinates
Hello,
I currently have a movie playing with a custom cursor using onMouseMove. What I would like add to this is, when a user is in specific coordinates (square) of the movie, while pressing the mouse down, an Mp3 sound plays, and when the user has released the mouse there is no sound.
Any suggestions? Please help!
Thank you!
View Replies !
View Related
/ And Root And Drag
Hi.
Just to check...maybe someone could explain me ....
I have this :
startDrag ("/boca", true);
But I was trying to make like this :
_root.boca.startDrag = true;
Yes. It doesn't work and I guess it's made not to work.
But I was thinking that if this: 'setProperty ("boca", _alpha, "10");' has the same result as this '_root.boca._alpha = 10;' maybe the drag could worked.
Just a guess.
Bye::::::::::::::::::
View Replies !
View Related
Drag Image Along X Inside Y Coordinates?
I am trying to generate a piece of script to place on a MC that allows the user to drag the MC, on press, along the X axis between two Y coordinates (say 20 and 100). leaving the MC at the coordinate it is released at.
Seems easy enough but no luck yet, anyone help?
Thank you kindly.
View Replies !
View Related
Rect Coordinates In Start Drag?
hi
I don't quite understand what the 4 parameters (top, left,bottom, right) stand for in the stratdrag . It is very unclear in the reference ( even in my own lagage!).
I want to constrain the drag of a MC to a certain area of the stage, but I don't understantd at all what the 4 parameters stand for in relation to the rectangle I want to constrain my drag to???
are they _x and _y of certain cornerrs???
thank you
C.
View Replies !
View Related
Drag And Drop Exact Coordinates
Hi! I almost have a drag and drop exercise completed, but am unsure of how to get the drop to end up in exactly the right spot. The way my code is right now is not giving me an exact drop. I know I need to setup exact x and y coordinates for each movieclip drop, but how do I set that up? Thanks for any help! Amber
Here is the code so far:
var startX:Number;
var startY:Number;
var counter:Number = 0;
var soundReq:URLRequest = new URLRequest("kidscheer.mp3");
var kidscheer:Sound = new Sound();
kidscheer.load(soundReq);
nic_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
nic_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
pan_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
pan_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
hon_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
hon_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
guat_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
guat_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
sal_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
sal_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
costa_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
costa_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
mexico_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
mexico_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
espana_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
espana_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function pickUp(event:MouseEvent):void {
event.target.startDrag(true);
reply_txt.text = "";
event.target.parent.addChild(event.target);
startX = event.target.x;
startY = event.target.y;
}
function dropIt(event:MouseEvent):void {
event.target.stopDrag();
var myTargetName:String = "target" + event.target.name;
var myTargetisplayObject = getChildByName(myTargetName);
if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
reply_txt.text = "Good Job!";
event.target.removeEventListener(MouseEvent.MOUSE_ DOWN, pickUp);
event.target.removeEventListener(MouseEvent.MOUSE_ UP, dropIt);
event.target.buttonMode = false;
event.target.x = myTarget.x;
event.target.y = myTarget.y;
counter++;
kidscheer.play();
} else {
reply_txt.text = "Try Again!";
event.target.x = startX;
event.target.y = startY;
}
if(counter == 8){
reply_txt.text = "Congratulations, you're finished!";
}
}
nic_mc.buttonMode = true;
pan_mc.buttonMode = true;
hon_mc.buttonMode = true;
guat_mc.buttonMode = true;
sal_mc.buttonMode = true;
costa_mc.buttonMode = true;
mexico_mc.buttonMode = true;
espana_mc.buttonMode = true;
View Replies !
View Related
X Y Drag And Drop Coordinates Confusion
Hi, I am working on a digital fiction story. You can see it at http://www.primalwounds.com/
But I am struggling to understand something at the moment. First, I should say that I mainly work in Flash MX2004, although I can get access to Flash 8 too. However, I would prefer to use MX2004 for now.
Anyway, my professor has sent me feedback on this particular page http://www.primalwounds.com/primal4/index-4.html
He says that he recommends that I make the bounding box larger so that the drag and drop jigsaw pieces at the end of this swf movie can be completely moved out of the way. He says that if I increase the X and Y coordinates to encompass a larger space, then users can drag the pieces as far as I want them
to.
According to him, if I was using Flash 8 and turned on Script Assist I would get code that might look like this onClipEvent (load) {
startDrag("", true, 100, 100, 500, 400);
}
But MX2004 does not have Script Assist and I do not really understand what this code above means. I have no idea what would be good parameters for the jigsaw puzzle I created at the end of http://www.primalwounds.com/primal4/index-4.html
Would anyone like to take a look at it and suggest to me what would be good parameters and how I should write the code. Can MX2004 use the same code as Flash 8? Sorry, but this whole thing completely baffles me at the moment. I have tried searching on line for info about bounding boxes and parameters, but the articles do not seem to address my issue.
I would be really grateful for any help you can give me on this, but keep it dead simple.
Thanks for your time,
Marchan
Edited: 05/16/2008 at 06:32:34 AM by mking10
View Replies !
View Related
Place Whole Movies X, Y Coordinates, How
if you work with levels, and you want to load a new whole movie on a certain x, y coordinate.... how do you do that..
now i use this method...
the movie that has to be loaded on top of level 0, i am giving it the exact same height en length as the movie on level 0, and then i place the object in this almost empty movie, at the place where i want it to be....
there must be an easier way right?
View Replies !
View Related
Draggable Movies To Specified X/Y Coordinates
I have 13 Buttons that are draggable. 9 desktop computers, a cable modem, a 3Com Switch, a wireless router, and a normal router. I want the user to try and set up a network without help but then have a static button that on release slowly moves all the pieces to their respective places.
I see a problem in having all 9 of the computers as different instances because if one is in the right spot for a computer... but it's not the right instance of computer it will move around when it doesn't need to. so I need each of my computers to be able to snap to either of the nine computer spots without trading.
View Replies !
View Related
Draggable Movies To Specified X/Y Coordinates
I have 13 Buttons that are draggable. 9 desktop computers, a cable modem, a 3Com Switch, a wireless router, and a normal router. I want the user to try and set up a network without help but then have a static button that on release slowly moves all the pieces to their respective places.
I see a problem in having all 9 of the computers as different instances because if one is in the right spot for a computer... but it's not the right instance of computer it will move around when it doesn't need to. so I need each of my computers to be able to snap to either of the nine computer spots without trading.
View Replies !
View Related
Drag And Drop Elements And Write Coordinates To Database
Dears friends,
i have goal to score. i need help
the goal is to drag and drop an element to a scene. and later write the coordinates of the element to the database.
so when the user returns and logs in they can continue to decorate the scene from where they left...
i am writing in php mysql.
any quick help will be very usefull.
write the coordinates of the element to the database.
cheers.
thnx a billion
View Replies !
View Related
Calling Movies And Coordinates At Random.
Okay, I got a good one for you flash gurus. Picture this. Remember those old gofer arcade games with the big hammers? You know, the one where the gofer pops out of a hole and you try to smash him with the hammer, but you never know which hole he's coming out of. I want to simulate that with flash...only with a little twist. If possible I'd like to use 5 or 6 "gofer" movie clips and call them at random. Any clues? I also need to call the predefined x,y coordinates (for the holes) at random. The end result being that you never know which gofer is going to come out of which hole. So, here's my question: How exactly do I call on movie clips at random? And even more confusing, how do I assign my coordinates at random. I imagine I'll be using math.random, but in which way?
Oh mighty flash gurus, please help.
Thanks,
AntiX
View Replies !
View Related
Limits For Coordinates In Flash Movies?
Hello!
Here's something I'm wondering:
I've made a text-scroller myself which scrolls by changing its height and _y position.
At some point - and I’m pretty sure my code is correct because I did trace the coordinates - the movieclip just disappears.
The trace looks as follow:
Scrolling up
Height: 5313.25 Y: -88.9 //displayed
Height: 5313.25 Y: -56.95 //not displayed
Scrolling down
Height: 5968.95 Y: -5358.05 //displayed
Height: 5968.95 Y: -5388.95 //not displayed
I think my question is, is there a min and max coordinate for flash to render and display controls?
As far as I can see it is also not possible to position something at a coordinate of 6000 - I get the message: invalid value.
Hmmm... Is that something one has to live with or is there perhaps a way around that?
Does anyone know more on this?
View Replies !
View Related
How Do I Get To The Root Of The Movie From Within Movies?
Hey Guys
Ok i've built a flash site, but i have animation within movies, that are within movies...lol
Basically when the last movie file finishes i need the flash file to change scene.
I have some actionscript that will go to the root of the movie and change scene but i dont seem to be able to get it to peform the action on its own just using a goto and play or something like that...I dont want to have to press a button to change the scene
Here is the code for the button root:
on (release){
_root.gotoAndPlay("Home5");
}
If anyone can help that would be great!
Thank you!
View Replies !
View Related
Move Coordinates Of Multiple Movies Over Frames
Ive made a movie on my main timeline with about 300 frames and 7 or 8 layers. Is there an easy to move all of the movie clips across all the frames to a different coordinate on the stage? The objects on stage are aligned to the top left of the screen and i want to have it be center aligned.
View Replies !
View Related
Playing Root Timeline Across Movies
I have two swf files.
Main.swf is displayed which loads home.swf. Home has a close button with the following code:
Code:
on (release) {
unloadMovie("_root.loadInTo");
//_root.main2.gotoAndPlay(1);
gotoAndPlay("_root.main2");
}
it unloads itself fine (as i see it disappear) however i cannot then play the main timeline. (everything is contained in a movieclip called "main2" - so i was trying to play that.)
thanks.
View Replies !
View Related
Atchd Or Duplcted Movies Cant Access Root On Mac
this must be a bug, cause it works fine on pc...
but it was ment to work on both pc and mac, so if anyones seen this problem before and has a solution or workaround, its more than welcome, the problem is:
i attached (tried also with duplicate later on) a movie like:
_root.ss.kuva.attachMovie("kuvaclip", "kuva"+l, l);
value of l comes from a for loop...
then in the attached movie i have a another clip (only way i know to get object actions in attached movies is to have 2 clips, that sucks!!) that has actions in an on(data) event, some code and then call to root or parent, either dont work, i tried:
_root.koe="pevev";
trace(_root.koe);
as a debug, result was an empty string!!
so on a mac attached or duplicated movies cant call root or parent, works FINE on pc!! if u have a solution, PLEASE tell me, otherwise i might have to send a letter bomb to macromedia(just kidding), but this relly sucks cause i promised to my client both mac and pc versions(projector) and coded it on pc and then this unexpected BUG messed up everything and the mac version became impposible to code!!
View Replies !
View Related
RollOver/RollOut Controlling Root Movies.
I have 2 questions with regard to this code by kirupa.com & posted by jzeroj0 which does EXACTLY what I wanted with regard to rollover/rollout.
stop();
this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}
this.onRollOver = function(){
rewind = false;
play();
}
this.onRollOut = function(){
rewind = true;
}
I have to have text windows (graphic movie instances) fade in as well only they overlap some of the image and need to be placed atop the graphic fade-ins in the timeline window.
My first attempt to control the root movies:
I placed the commands within a graphic fade-in movie instance as the first frame
I tried this:
this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
_root.txtblok1.prevFrame();
}
}
this.onRollOver = function(){
rewind = false;
play();
_root.txtblok1.play();
}
this.onRollOut = function(){
rewind = true;
}
And it worked the first time, then only worked on the text blok fade-in and Not the graphic.
Then I tried controlling both the graphic fade-in and the text fade-in from a separate movie instance:
stop();
this.onEnterFrame = function(){
if(rewind == true){
_root.TTub1.prevFrame();
_root.txtblok1.prevFrame();
}
}
this.onRollOver = function(){
rewind = false;
_root.TTub1.play();
_root.txtblok1.play();
}
this.onRollOut = function(){
rewind = true;
}
This tends to work ONCE then acts weird. While the second button (controlling TTub2 & txtBlok2) doesn't work at all.
I feel like something must need to be "Re-Set" perhaps,
The structure is the same as the flash_button file enclosed.
I am on Flash 8 on Mac 10.4.11.
View Replies !
View Related
Loading/Unloading Movies On Root From Nested SWF
here's my situation...
1. A loader is on the Root. It loads a movie:
Code:
var loadMovie = new Loader();
container.addChild(loadMovie);
loadMovie.load(new URLRequest("subWhoWeAre.swf"));
2. A nested movie calls to the Root and says, "unload that movie and load this other one instead."
Question: How would you unload a movie (removeChild) from the parent timeline via a nested mc and load a new one (addChild)?
Thanks.
View Replies !
View Related
What A DRAG Drag 2 Movies?
I have a movie clip that is draggable, and in that movie clip is a dynamic text area that has a scroll bar (with 2 arrows also) However, with the drag on the entire movie clip, the drag that makes up the scroll bar doesn't work. you cannot drag 2 movies at the same time. So right now I only have the arrows, but I'd really like to find out how to have a scroll bar inside a draggable movie.
I have a "drag" tab on my movie, is there a way to make that tab the only place to click and drag the movie?
Thanks for any help!
View Replies !
View Related
How Drag 2 3 4 ... Movies
Hi Flash World;
I need some help because I want to drag more than one movie at the same time... what I have to do? I want to move more than three movies.... please, somebody could help me?
Thank you for your time reading this question...
View Replies !
View Related
Two Movies Drag
Hi guys,
Is it possible to use twice startDrag action on a buttton for two different movie clips.
So when you push the button movie A moves to left and movie B moves to right. The structure is a bit more complicated as I have 6 buttons and the movies have to move back and forward. I can move the first movie with startDrag comand and new position variable but I can make the second one move.
Also if you see other ways to do this. the advise will be very welcomed.
thank you,
R
View Replies !
View Related
Drag Two Movies
on the stage i call for to movies (swf) and both of them contaon movie clips that call "map" 1. _level2.map 2. level 5.map.
i also got a movie clip that call "map" on the stage _level0.map, can i drag them all together?
View Replies !
View Related
Loading Drag And Drop Movies
I'm trying to load a movie that contains a drag and drop button into a target in my main movie. When it loads into the main movie it is no longer draggable.
If I remove the x and y coords of the target the drag and drop movie will load into the main movie functioning properly, yet it will load just any ol' where and cover up other portions of my main movie.
Does anyone know how to load a drag and drop movie into another movie in a specific location while retaining it's drag and drop functionality?
Actions currently in use on Frame One of Main Movie:
loadMovie ("product_01.swf", "Target One");
setProperty ("Target One", _x, "11");
setProperty ("Target One", _y, "37");
View Replies !
View Related
Drag And Drop In Multiple Movies
i hav one main swf which load another 2 swfs (one is navigation and another is my content page). nw problem is i have created my content page which hav drag and drop function.
at first, im happy wif the effect and function. but when i load main swf, the drag and drop stop functioning..T.T
can anyone see wat the problem and hw to fix it??
View Replies !
View Related
Drag And Dropping Duplicated Movies
I know how to duplicate movies and drag and drop, but for seperate things.
Is there any way of Duplicating a movie and then calling upon it to drag and drop it else where? I can't seem to get it working since the script for drag and drop calls upon an instance name - and the instance name for the duplicated movie has a variable at the end so its different all the time
eg duplicateMovieclip("movieclip", "instance name"+i, i)
I don't even know if its possible calling upon an instance name that doesn't exist until something is clicked O.o;
*hopefully this is in the right thread >_<;
View Replies !
View Related
Hit Test -- Drag N Drop Movies As In Www.wmteam.de
Good Flash Folk...
Here's my dilema
I want to drag a movie clip, called "icon" into a demarkated area called "dropzone". When the mouse button is released, the "icon" mc should snap to the dropzone area and initiate a movie, based on the instance name of the "icon".
In other words...
You have a total of 9 icons called "icon1, icon2, icon3 etc. I want to select and drag these icon mc's (individualy of course) to ONE demarkated area, it snaps to it, and plays a particular mc, based on the instance name of the "icon".
I think this has something to do with hittest.
Any good tutorials out there ??
Thanx
Fabman
View Replies !
View Related
Drag And Drop Target On Imported Movies
Hi All,
I am in a bit of a bind here, I am doing a finals for my Flash class in college and our assignment is to make a portfolio that show cases our past work, well I had made an easter egg hunt SWF where object is to find eggs and drop them into a bucket, main use of action script is the drag and drop target, By itself the SWF runs just fine but when I try to import that swf by method LoadMovie ( I am loading all my shows externally) my drag and drop target breaks. I can drag the egg over to the bucket but it dont "drop" the intial code for the drag and drop is this
code -->
on (press) {
startDrag("");
}
on(release) {
stopDrag();
if (eval(this._droptarget) == _root.EasterBasket) {
setProperty(this, _visible, false)
_root.count --;
tSound = new Sound(this);
tSound.attachSound("thump");
tSound.start(0,0);
}
}
<-- end code
I have tried using the lockroot command to keep the timelines seperate but that didnt help, I changed the _root.EasterBasket to this._parent.EasterBasket to get rid of root reference but that didnt work either. is there a better mousetrap out there that I can use for this drop and drag target that will work when it is imported to another SWF, I need help fast please, this project is due here pretty quick, thanks all, D-Wiz
View Replies !
View Related
Start Drag And Target On Loaded Movies
I have an swf that I load and unload a series of swf movies on. One of my loaded movies has a drag and target function. The idea is, i drag an object to a garbage can, and it goes away. Simple, works like a charm if I open it up on its own, but doesn't work at all when opened up as a loaded movie on a layer of another SWF.
this is the type of actionscript I'm using.
this.onRelease = function() {
if (this._droptarget == "/thetrash") {
this._visible = false ;
_root.gotoAndPlay(97);
};
any suggestions?
View Replies !
View Related
Controlling Root With MC Loaded Into Empty MC On Root
I have a movie in which there are 7-8 Empty movieclips put on the stage. I load movieclips into these on load and from some Btns on the main or root movie. Now I'm trying to change out one of these empty MCs from a MC loaded into another empty MC....If that makes any sense?? Here's the code:
code:
onPress = function () {
this.gotoAndPlay(frame);
if (code == "1"){
_parent.getURL(site, target);
}
else if (code == "0"){
fscommand("exec", fs);
}
else if (code == "2"){
_root.clipnmone.loadMovie(movie, clipnmone);
_root.clipnmtwo.loadMovie(movie2, clipnmtwo);
}
}
I'm getting the Vars clipnmone & clipnmtwo But I can't seem to hit the clip on the root movie. It's called clip4. Now, it works if I put the clip name in place of the Vars. If someone could point out what I'm doing wrong, that would be great. Thanks for your help and time on this. Oh, and I'm using Flash vers 6. So, please don't send me 2004 code. Thanks.
View Replies !
View Related
[AS3] _root Or Var Root = Root;
Pls.. i need help to find _root (as2) on my project AS3.
_root.gotoAndStop(2);
And AS3 I have used:
var root = root
root.gotoAndStop(2);
This is a bug ???
I can´t understand ??
Why i need white var root = root ???
Somebody know other way to do this ???
tnx for all
View Replies !
View Related
Questions About The Using Of Root And This.root
Hi,
I have some questions about the using of "this" and "root":
Why the following codes works:
Quote:
var r = root;
r.myText_txt.text = "Kirupa Forum";
But not this:
Quote:
root.myText_txt.text = "Kirupa Forum";
And why the following also works:
Quote:
var r = this.root;
r.myText_txt.text = "Kirupa Forum";
But not this:
Quote:
this.root.myText_txt.text = "Kirupa Forum";
Thanks and best regards
Alex
View Replies !
View Related
(1)drag Drop In 3 (2)drag Dropin 3 ...print 3 Contents (1)+(2)
i want to do the following.
drag (dynamic text file link)1 of choice of x text file links
into an area where all text file links can then be printed..(the text file itself)
[1] [2] [3] [4] [5]...
(basket)
drag drop [1] then [2] then [3] then [4] into (basket)
then print textfiles related to [1] [2] [3] [4]
if sombody could point me to a good tutorial or help me on my way?
thanx
View Replies !
View Related
Drag Dial (ie Drag Point In A Circular Motion)
I want to incorporate a dial (such as volume dial on a TV, or a timer dial on a microwave) so that when the user clicks on the dial they can move the dial up and down, but in a circular motion.
Does anyone know where I can get a tutorial/movie that would help me with that?
Does that even make sense?!
View Replies !
View Related
Drag Function Lost In Main .swf When Drag External .swf
using MX:
I made this really cool menu that acts like the MAC OS X buttons...
The only problem that i have is when i load an external .swf (which is a window) and drag the window the startdrag funtion on the MAC OS X buttons stops working...
so to break it down:
Main .swf:
Quote:
startDrag("dragscale", true);
then the code in the buttons to make then scale (this code may not matter):
Quote:
colnum = "1";
startnum = 1;
endnum = 6;
numberofItems = 6;
mouseposX = int(getProperty("../dragscale", _x));
mouseposY = int(getProperty("../dragscale", _y));
i = startnum;
m = startnum;
filledSpace = 0;
gapspace = 0;
if (Number(myInit) == Number(false)) {
// on first run make an array of all the text Y Pos.
while (Number(i)<=Number(endnum)) {
set("textY" add i, getProperty ("text" add i, _y ) );
i = Number(i)+1;
}
i = startnum;
myInit = true;
}
boundleft = getProperty ("../boundbox" add colnum, _x);
boundright = boundleft + getProperty ("../boundbox" add colnum, _width) ;
boundtop = getProperty ("../boundbox" add colnum, _y);
boundbottom = boundtop + getProperty ("../boundbox" add colnum,_height);
if (Number(mouseposX)>=Number(boundleft) and Number(mouseposX)<=Number(boundright) and Number(mouseposY)>=Number(boundtop) and Number(mouseposY)<=Number(boundbottom)) {
while (Number(i)<=Number(endnum)) {
myDif = (eval("textY" add i) ) - (mouseposY - boundtop);
// percentage increase
scaleAmount = 150-((myDif*myDif)/16);
alphaAmount = 100-((myDif*myDif)/6);
if (Number(alphaAmount)<50) {
alphaAmount = 50;
}
if (Number(scaleAmount)<100) {
scaleAmount = 100;
}
setProperty("text" add i, _xscale, scaleAmount);
setProperty("text" add i, _yscale, scaleAmount);
setProperty("text" add i, _alpha, alphaAmount);
i = Number(i)+1;
}
// *** add up total Y pixels taken by text ***
while (Number(m)<=Number(endnum-1)) {
filledSpace = filledspace + getProperty ( "text" add m, _height);
m = Number(m)+1;
}
// *** find total Y pixels not taken by text
totalheight = getProperty ( "text" add endnum, _y) - getProperty ( "text" add startnum, _y);
gapSpace = totalheight-filledspace;
avgDistance = gapSpace/numberofitems;
m = Number(startnum)+1;
while (Number(m)<=Number(endnum-1)) {
setProperty("text" add m, _y, (getProperty ( "text" add (m-1), _y) + getProperty ( "text" add (m-1), _height)) + avgdistance);
set("watchheight" add m, getProperty ( "text" add m, _height));
m = Number(m)+1;
}
} else {
// *** shrink text back when mouse rolls out
i = startnum;
while (Number(i)<=Number(endnum)) {
if (int ( getProperty ("text" add i, _yscale ) ) >= 100) {
// return scale back to original state
setProperty("text" add i, _yscale, int ( getProperty ("text" add i, _xscale ) ) - 1);
setProperty("text" add i, _xscale, int ( getProperty ("text" add i, _yscale ) ) -1);
}
if ( getProperty ("text" add i, _y) < eval("textY" add i)) {
// return y position back to original state
setProperty("text" add i, _y, int ( getProperty ("text" add i, _y ) ) + 1);
}
if ( getProperty ("text" add i, _y) > eval("textY" add i)) {
setProperty("text" add i, _y, int ( getProperty ("text" add i, _y ) ) - 1);
}
if ( getProperty ("text" add i, _Alpha) > 50) {
setProperty("text" add i, _alpha, int ( getProperty ("text" add i, _alpha ) ) - 1);
}
i = Number(i)+1;
}
}
NOw the External .swf code:
Quote:
on (press) {
startDrag ("_parent.win2")
}
on (release) {
stopDrag ();
}
I am pretty sure the "on release stopDrag" code is making the above buttons stop scaling...
How can i make it only stop draging the window not the entire movie??
basic question is it posible to have multiple dragable objects in one movie clip???
View Replies !
View Related
Drag Function Lost In Main .swf When Use Drag On External .swf?
using MX:
I made this really cool menu that acts like the MAC OS X buttons...
The only problem that i have is when i load an external .swf (which is a window) and drag the window the startdrag funtion on the MAC OS X buttons stops working...
so to break it down:
Main .swf:
quote:
--------------------------------------------------------------------------------
startDrag("dragscale", true);
--------------------------------------------------------------------------------
then the code in the buttons to make then scale (this code may not matter):
quote:
--------------------------------------------------------------------------------
colnum = "1";
startnum = 1;
endnum = 6;
numberofItems = 6;
mouseposX = int(getProperty("../dragscale", _x));
mouseposY = int(getProperty("../dragscale", _y));
i = startnum;
m = startnum;
filledSpace = 0;
gapspace = 0;
if (Number(myInit) == Number(false)) {
// on first run make an array of all the text Y Pos.
while (Number(i)<=Number(endnum)) {
set("textY" add i, getProperty ("text" add i, _y ) );
i = Number(i)+1;
}
i = startnum;
myInit = true;
}
boundleft = getProperty ("../boundbox" add colnum, _x);
boundright = boundleft + getProperty ("../boundbox" add colnum, _width) ;
boundtop = getProperty ("../boundbox" add colnum, _y);
boundbottom = boundtop + getProperty ("../boundbox" add colnum,_height);
if (Number(mouseposX)>=Number(boundleft) and Number(mouseposX)<=Number(boundright) and Number(mouseposY)>=Number(boundtop) and Number(mouseposY)<=Number(boundbottom)) {
while (Number(i)<=Number(endnum)) {
myDif = (eval("textY" add i) ) - (mouseposY - boundtop);
// percentage increase
scaleAmount = 150-((myDif*myDif)/16);
alphaAmount = 100-((myDif*myDif)/6);
if (Number(alphaAmount)<50) {
alphaAmount = 50;
}
if (Number(scaleAmount)<100) {
scaleAmount = 100;
}
setProperty("text" add i, _xscale, scaleAmount);
setProperty("text" add i, _yscale, scaleAmount);
setProperty("text" add i, _alpha, alphaAmount);
i = Number(i)+1;
}
// *** add up total Y pixels taken by text ***
while (Number(m)<=Number(endnum-1)) {
filledSpace = filledspace + getProperty ( "text" add m, _height);
m = Number(m)+1;
}
// *** find total Y pixels not taken by text
totalheight = getProperty ( "text" add endnum, _y) - getProperty ( "text" add startnum, _y);
gapSpace = totalheight-filledspace;
avgDistance = gapSpace/numberofitems;
m = Number(startnum)+1;
while (Number(m)<=Number(endnum-1)) {
setProperty("text" add m, _y, (getProperty ( "text" add (m-1), _y) + getProperty ( "text" add (m-1), _height)) + avgdistance);
set("watchheight" add m, getProperty ( "text" add m, _height));
m = Number(m)+1;
}
} else {
// *** shrink text back when mouse rolls out
i = startnum;
while (Number(i)<=Number(endnum)) {
if (int ( getProperty ("text" add i, _yscale ) ) >= 100) {
// return scale back to original state
setProperty("text" add i, _yscale, int ( getProperty ("text" add i, _xscale ) ) - 1);
setProperty("text" add i, _xscale, int ( getProperty ("text" add i, _yscale ) ) -1);
}
if ( getProperty ("text" add i, _y) < eval("textY" add i)) {
// return y position back to original state
setProperty("text" add i, _y, int ( getProperty ("text" add i, _y ) ) + 1);
}
if ( getProperty ("text" add i, _y) > eval("textY" add i)) {
setProperty("text" add i, _y, int ( getProperty ("text" add i, _y ) ) - 1);
}
if ( getProperty ("text" add i, _Alpha) > 50) {
setProperty("text" add i, _alpha, int ( getProperty ("text" add i, _alpha ) ) - 1);
}
i = Number(i)+1;
}
}
--------------------------------------------------------------------------------
NOw the External .swf code:
quote:
--------------------------------------------------------------------------------
on (press) {
startDrag ("_parent.win2")
}
on (release) {
stopDrag ();
}
--------------------------------------------------------------------------------
I am pretty sure the "on release stopDrag" code is making the above buttons stop scaling...
How can i make it only stop draging the window not the entire movie??
basic question is it posible to have multiple dragable objects in one movie clip???
View Replies !
View Related
Drag 2 MCs, Kinda...drag 1MC, Follow MC Half?
i want to drag an object and have another mc to move half that distance. im trying to get the nondragMC to move half the distance from the bottom of the stage than the dragMC is moved by the user. they both start at the bottom of the stage and when the user drags the dragMC up, i want the other mc to move half the distance with the drag. dont know what script i should use. anybody got any ideas?
View Replies !
View Related
Stacking Drag Movie Lagging When Drag...
just wonder if anyone know how to solve these problem.
i have load in a .swf and this .swf is make up of one drag object. When i load into my _level0, i can drag it but it seem then the drag is not smooth, instead it is lagging. Thus i went back to the indiviual files and try to drag on it and it was not lagging. ...why is it like that? All the files are still on my local disk. Can't imgaine what will happen if it is on the net. Please help! is this normal for drag object ?
View Replies !
View Related
Loading Movies Inside Other Movies In An Ext Movie Holder?
Here's one for you:
I've got my main movie that has a movie holder on it (entitled movieholder.) The buttons on the left control what goes in the movie holder. In one of the movies there is a list of songs that are actually buttons. These buttons call up another movie(with MP3s). How do I get the MP3 movies to go into "movieholder" when they are being called by a button inside 'movieholder'
I'm using MX
Hope that made a slight bit of sense!
Thanks for any help,
Graeme
View Replies !
View Related
Trouble Creating Reverse Rollover Movies Within Movies
Hey ooh my first post.
I have been having trouble creating a movie clip with a reverse rollover effect within a movie which has a reverse rollover effect. that sounds confusing
In essence I wish to create a panel that rolls out on rollover and rolls back in reverse when the you rollout. I have done this using this script
stop();
this.onEnterFrame = function() {
if (rewind == true) {
prevFrame();
}
};
this.onRollOver = function() {
rewind = false;
play();
};
this.onRollOut = function() {
rewind = true;
};
However I wish to make movies within this movie that have the same effect on them. But when I create another movie or button within this movie it is not registering on rollover. I guess because the script on the main movie overrides it?
Sorry for the poor explantion, any ideas?
View Replies !
View Related
Drag Drag Drag Menu
hi everyone
i have created a basic dragable menu, what i want to happen is that the menu can only be dragged in y position,or moves in y and slightly moves in x,....... what should be done?
this is the script:
on (press) {
startDrag("/drags");
}
on (release) {
stopDrag();
}
thanxxxxxxx
View Replies !
View Related
Coordinates
Shew, so much to learn. Here's my problem. Say I want to compare an objects coordinates in one MC to some in a different movie clip. I've been making all of my MC's top left origin 0,0 (not the center) which has been helpful in comaring them correctly atleast to the root level. I know that there is a function in ActionScript that get's local or global coordinates. I found the function's description and board messages that were pertaining to it confusing so haven't used it yet. Can you help? Do you have any recommendations how to handle this? What do you do? Thanks! - Michelle
View Replies !
View Related
Coordinates
Hey
Uhm I need to know something....what kinda script i have 2 use...
In my flash movie Ive got on the left side of the screen a map where the user is able to navigate through.The Screen seems like this
-----------------------------------------------------
BIG MAPXXXXXXXXXXXXXXXXX ¦ XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXX ¦ XXXXLITLLE MAPX
XXXXXXXXXXXXXXXXXXXXXXXX ¦ XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXX ¦ XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXX ¦
XXXXXXXXXXXXXXXXXXXXXXXX ¦
XXXXXXXXXXXXXXXXXXXXXXXX ¦
XXXXXXXXXXXXXXXXXXXXXXXX ¦
XXXXXXXXXXXXXXXXXXXXXXXX ¦
-----------------------------------------------------
The BIG map is able to zoom so to know where ya are on the map there is the litlle map.How do I trace the coordinates in the big map and put them in the little map?Hope you understand me...
Thanks
Martijn
¦
View Replies !
View Related
Coordinates Nav
Hi - I saw an effect I want to try to duplicate - I want to be able to tell a MC to go to a specific x position and a specific y position from any spot - - so let's say I am at 50x and 60y and I want to go to 10x and 35y. I just need the logic and method to do this. I come close but the MC starts jumping around and being all nutty - I guess id the coordinates are not divisible by the rate at wich the MC moves it jupms - how can I avoid this? Thanks!
View Replies !
View Related
Coordinates
I need my spaceship not to enter som x and y coordinates.. does anybody know how to do this ?
i have a town on the bottom and i dont want the spaceship to fly in front of if, i need the ship to stop before it gets so low..
thnx !
S.Boy
View Replies !
View Related
|