Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Drag Restrictions



i have a box inside of a frame. when the user starts dragging the box, i would like it to go no higher than the top of the frame, and no lower than the bottom, also, it needs to be restricted to the y axis. i have accomplished the latter, but i can't figure out how to keep the box inside of the frame, thanks!



FlashKit > Flash Help > Flash MX
Posted on: 09-11-2003, 09:59 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Drag Movement Restrictions And Mc Timeline Control
Hey guys.
I was wondering cause i have a movie clip called leftleaver_mc and ive made it dragable with the following codes.

this.leftswitch_mc.onPress = function() {
leftswitch_mc.startDrag()
}

this.leftswitch_mc.onRelease = function() {
leftswitch_mc.stopDrag()
}

that code obviously works but i what i want to do is make it so they can only drag up and down between the y coordinates of 990.1 and 793.8 on the stage and also not beable to move from the x coordinates of 276.4 while there dragging up and down.
================================================== ====
also another thing is when there moving the the leftswitch_mc up and down between them coordinates i want it to control an animation ive made in another mc called testcylinder_mc like the frame lable i want it to control in the cylinder mc is around 30 frames long starting at frame 6 of the mc's timeline and if they movie the leftswitch_mc up i want it to play that frame forward at normal speed and if they move leftswitch_mc down i want it to play that frame in reverse at normal speed and also if leftswitch_mc is at its original starting point i want the cylinder mc to return to frame 1.

thanks for reading i hope ive exsplained it easy for u guys to understand and to beable to help.

thanks in advanced

Help: Drag Movement Restrictions And Mc Timeline Control
Hey guys.
I was wondering cause i have a movie clip called leftleaver_mc and ive made it dragable with the following codes.

this.leftswitch_mc.onPress = function() {
leftswitch_mc.startDrag()
}

this.leftswitch_mc.onRelease = function() {
leftswitch_mc.stopDrag()
}

that code obviously works but i what i want to do is make it so they can only drag up and down between the y coordinates of 990.1 and 793.8 on the stage and also not beable to move from the x coordinates of 276.4 while there dragging up and down.
================================================== ====
also another thing is when there moving the the leftswitch_mc up and down between them coordinates i want it to control an animation ive made in another mc called testcylinder_mc like the frame lable i want it to control in the cylinder mc is around 30 frames long starting at frame 6 of the mc's timeline and if they movie the leftswitch_mc up i want it to play that frame forward at normal speed and if they move leftswitch_mc down i want it to play that frame in reverse at normal speed and also if leftswitch_mc is at its original starting point i want the cylinder mc to return to frame 1.

thanks for reading i hope ive exsplained it easy for u guys to understand and to beable to help.

thanks in advanced

If And 2 Restrictions
very very easy, but can't get it working

_root.onEnterFrame = function () {
if (var1>50 && var2=23) {doSomething();};
}

if 2 variables are at a certain number do something?

thanx in advance

Adding _y Restrictions
Iv got this object that follows the mouse and slows down.
this is the script..
onClipEvent (enterFrame) {
trgt_x = _root._xmouse - _x;
_x = _x + (trgt_x/5);
}

whats the easiest way to add _y restrictions so the slider only moves in a given place.

Draw Restrictions?
how do I make draw restrictions, so I cannot draw on the tool bars or other things, exept one display. Check the attachment so you understand better.

-=Thanx=-

Load Restrictions?
Hello,

i've posted a threat some time ago in the 'beginners forum', but after some experimenting i've realised that the problem that i'm having maybe isn't really a beginners problem, so i'm going to rephrase it here :

I'm trying to siply load an xml file, stored on a server somewhere.
I originally thought that i had a syntax error, because it always said "unable to open url".
But now i've uploaded the swf to the same folder as the xml file (on that server) and then it works fine.
I've done some researching and appearantly this has something to do with security issues. In flash versions 6 and higher, you can't load xml anymore. Unless you use the method System.security.allowDomain() in the remote flash file. But the problem i have is that the xml file is actually a php file, that echoes an xml, so i can't use this method of course.
So i could work around this problem if i publish and upload the whole swf for every test, but debugging is really hard that way because i can't trace then.
I can imagine that a lot of you already had that problem so there must be someone who can help me with this!!

Thanks!

M

DuplicateMovieClip Restrictions?
Is there any reason why I can only duplicate one MC per on (press) ?

I have perfectly working (though ugly) code that duplicates a box_mc X number of times.

If I want to duplicate another object the same number of times then only either or works, not both. I have put the other box code in various locations and only one will work.

Both work fine (individually) when the other code is commented out.

I'm losing my hair on this.

Thanks

Instance Name Restrictions
i searched in forum but didnt get any result.. sorry if i missed.

i wanna learn something? why instance names cant start with a number?

is there a restriction for instance names? if there is.. what are these restrictions all about?

Draggable Object Restrictions
I trying to drag an object within flash. The dragging bit is easy, but I do not want the user to be able to drag the object off the screen. Do I have to set some kind of restrictions on where the user can move the object to?

Instace Names - Restrictions From MX 2 V5
Can anyone tell me what the restrictions are on instance name in MX when exporting to Flash 5?

I am getting the following error when using 'inputText' as an instance name. I am also getting other errors for button instances etc. Is there a max length?

---------------------------------------------------------
Scene=Scene 1, Layer=Input Text, Frame=79: Flash MX Text Field Instance Name
---------------------------------------------------------

Player7 Security Restrictions
You must have seen those alerts on websites already, when attempting to load from another domain or subdomain.

More info from Macromedia:
http://www.macromedia.com/devnet/mx/...curity_03.html

While there, you can read the whole article.

Also from Colin Moock:
http://www.moock.org/asdg/technotes/...inPolicyFiles/
gparis

Key Press Event Restrictions?
I have a movie that i want people to be able to get rid of whenever they click on the movie or press a key but when i use the Keypress event, i am restricted to one key, no option for any button being pressed - is there any way around this or will i have to put up with only one key being active?
Thanks

XML.load And Security Restrictions
Hi,

I have read the below blurb from macromedia:

http://www.macromedia.com/devnet/mx/..._security.html

- but I thought Id come here to confirm I can do or not do exactly what Im thinking.

I want to give the client a CD with a flash exe made in MX 2004 that uses the XML.load stuff. It needs to load in data from some domain:www.somedomain.com, but the client ought to be able to put in their CD anywhere in the world and it will go get the data. Is this possible?

Im confused because the macromedia article talks about the flash player not being able to load data from anywhere but the domain that the calling movie is in. But my CD isnt in a domain - its just on someones PC.

I hope someone can help.

Thanks,

Tim.

Window Size RESTRICTIONS
How can i restrict the window size for a flash site? THanks a bunch

Preloading Images And Restrictions?
Is there some sort of size limits placed on files loaded into flash?

I am preloading images and if I specify an image over 25K, the preloading just hangs. If the files are under 25K, everything works great.

This is really driving me crazy. ANY help would be greatly appreciated!!!

Here is the code I am using:

Frame 1
================================================== ==============
this.onLoad = onThisMovieLoaded;

// first thing to do
function onThisMovieLoaded() {
// get that xml
loadPhotoXML();
}

// load up that xml
function loadPhotoXML() {
photosXML = new XML();
photosXML.ignoreWhite = true;
photosXML.onLoad = onPhotosXMLLoaded;
photosXML.load("thumbnails.xml");
}

// once your XML is loaded, load up the images
function onPhotosXMLLoaded() {
imageNodes = this.firstChild.childNodes;
loadInSeq(0);
}

// loading images
function loadInSeq(i) {
// create an empty movie clip and set it's depth to i
var slide = this.createEmptyMovieClip("slide"+i, i);
// hide all slides loading on top of first one
if (i>0) {
slide._alpha = 0;
}
// load the image into the empty movie clip
slide.loadMovie(imageNodes[i].attributes.path);

checkLoadedID = setInterval(CheckSlideGetsLoaded, 1000/fps, i, this);
}


// call this function that recursively calls itself
// which will keep refreshing itself until the movie clip
// has a width and then it will re-exec the load in seq function
function CheckSlideGetsLoaded(i, mc) {
// if the movie is loaded (and has a width)
if (mc["slide"+i]._width > 0) {
// make sure it is visible
mc["slide"+i]._visible = true;
// call clear interval to break us out of this current loop
clearInterval(checkLoadedID);
trace(i);
// but first start loading the next pic
if (i < mc.imageNodes.length-1) {
mc.loadInSeq(i+1);
// unless all photos are loaded
} else {
// start displaying new photos
trace("done");
}
}
}








thumbnails.xml (where 4th & 5th images [450day11_photos.jpg & 450day16_rainbow.jpg] should cause the process to hang because they are like 33K...if removed, everything works).
================================================== =================
<images>
<image path="http://seattlepi.nwsource.com/dayart/20040927/65day.jpg"/>
<image path="http://seattlepi.nwsource.com/dayart/20040927/65fashion.jpg"/>
<image path="http://seattlepi.nwsource.com/dayart/20021108/150clo08_puddleleaves.jpg"/>
<image path="http://seattlepi.nwsource.com/dayart/20040927/450day11_photos.jpg"/>
<image path="http://seattlepi.nwsource.com/dayart/20040927/450day16_rainbow.jpg"/>
</images>

Height And Width Restrictions
Hi

quick question. is there a height and width restriction in flash.
the actually main page i mean, are there restrictions.
reason i ask is i created the page 500 by 2100...now it's gonna be a pop up...which is 500 by 300 with a scrollbar. now for some reason it only displays most of the text..the rest does not show up...any idea why.

Randomize Array (with Restrictions)
hey all. i have a prototype function that randomizes the sequence of any array:

Array.prototype.randomizeArray = function () {
return this.sort(function(a,b) {return (Math.floor(Math.random()*2) == 0) ? 1 : -1;});
};

however, i would like to modify it so that the randomization guarantees that the no element in the new sequence is in the same position as it was in the original sequence.

in other words, if i have animalArray=new Array("cat","dog","bunny") and i call animalArray.randomizeArray(); ... then i want to make sure that the new animalArray never has "cat" in position 0, nor "dog" in position 1, nor "bunny" in position 2. what would be the best way to go about doing this? any help would be greatly appreciated.

cheers
j

[MX04] Following Curser Restrictions
Hello everyone,

Hope everythings going well.

I have a basic question, i have got an image following the curser but i want to restrict it from going below half way of the document.

i have a clear example here

www.viviensmodels.com.au
Click woman then melbourne.

The circle on the site follows the curser but doesnt go past the grey box.
i would like a direction on how to do this please.
im sure its a 1 liner code too.

thanks in advanced

Peter

Context Menu Restrictions
Can you still only create context menu's for the main movieclip and 1 child deep like it is in AS2?

i.e. Main MC > MC > Button/MC with context menu.

If I can do that in AS3 that would be great.

Dynamic Textfield Restrictions
how can i restrict the number of characters in dynamic textfiled?
and do empty spaces count?

Flash Intranet Restrictions
I am currently working on my company Intranet and there are areas where I would like to use Flash (primarily for video clips). However, there are several client machines that do not have Internet access. As such, I am unable to access http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0 in the Javascript function AC_FL_RunContent which is generated automatically when inserting the .swf or .flv file.

Does anyone know if there is a way to install the required download on the internal servers and redirect there instead?

Thanks for any assistance.





























Edited: 08/15/2007 at 12:44:20 PM by hebert_tsrhc

Dynamic Text Restrictions
I have a dynamic text box the the user inputs a single letter into. I want to retrict the dynamic text field to letters ONLY can I do that? I know restrict does but that only seems to work on INPUT text fields.

Restrictions Of HTML Inside SWF
A client wants to show complete html-pages inside a Flash movie. I've seen somewhere that this is possible through an IFrame, but then you can just rightclick the frame to view the source, and that's not what the client's looking for.

Ik know it's possible to parse simple html tags in Flash in a TextField, such as <b></b> <a href=""></a> etc etc, but what are the restrictions? For example, all css should work, even flash movies inside the html page should work. I think they're asking too much, so what exactly is possible and what's not?

Game Help - Restrictions And Jumping.
http://www.prophecydesigns.com/game/roughgame.swf
http://www.prophecydesigns.com/game/roughgame.fla

This is a new game I am working on. It is eventually going to be a fully graphical 2D Fighter (like Mortal Kombat or Street Fighter) but right now I am working on the engine for the game (Thus the Tylonel bottle character )
Implementing moves and stuff like that isn't a worry for me right now. I am pretty much getting the basics down. With that said I need help implementing a couple features.

I need suggestions/help on the best way to restrict a player from leaving the stage sides (they shouldnt be able to go off screen) and to restrict players from being able to go 'through' each other.
Now I've played around a bit with giving the character a walk speed variable and when he hit tests say 'player 2 - kevin' it turns that speed to zero but I have been having a hard time finding the best place to reinstate the value, so they can move again.
So can anyone give me a hand on the best way to implement these restrictions.

Also with jumping, I need to obviously make a hit test on the ground (since its 2D, left and right only) and then implement a gravity and jump speed. What would be the best way to do this?

Thanks for any tips. This project will probably take me until Summer to complete, but I'll gladly show improvements (my artist is currently drawing/animating, what you see now is temporary - lol)
Again, thanks in advance.

Generating A Random Number With Restrictions.
yea what's up dudes?

im learning actionscript as we speak.
i have "actionscripting in flash" by phil kerman
im on chapter 6 now.

right now i would like to generate a random number between 84 and 375.

the formula im using is this:

min=84
max=375
Math.floor(Math.random()*((max-min)+1))+min



ok, so is there an easier way?
there must be an easier way.
and with regards to my current formula,
what do i do after that...
like after it calculates the random number does Math.floor= the random number?

so then i would say, ("the random number is " Math.floor)

???
im a severe newbie, so
any help would be appreciated ten fold.

Text Field Character Restrictions
I have a text field that needs to only accept integers (0-9, no decimals), but since I have other text fields that accept letters, this one does, too.

Is there a way to restrict the character set for a particular text field?

Thanks,

Mark W

Random Movieclip Placement...BUT With Restrictions
Hiya, I've read quite a few of the existing posts but nothing seems to match my problem so this a last resort....

I'm creating a basic drag and drop exercise so basically i have lots of different movieclips which need to be placed in the correct spot, however, to make this less predictable I'd like to postion the movieclips in a new spot everytime the exercise is loaded.

This seems pretty easy enough using Math.random and size limitations according to size of my movie BUT i have the actual workspace onto which these movieclips have to be dragged is smack bang in the middle of the stage. SO my question is.... how can i place the movieclips on the stage randomnly each time the exercise is started up BUT not be positioned on the actual workspace??

I hope that makes sense

Any Restrictions With Frame Rate? [MX04]
I would like to make a movie with a 30 fps is it a good idea? the movie will be heavier, right? what else?


Panchoskywalker

MouseMove Restrictions For Background Image
Hello,

I'm attempting to create a website with a background image that pans when the mouse moves around. The image is enclosed by a border to hide where the image ends. I have worked a script that links the image to the mouse movement but have been unable to stop the movement continuing past the edges of the image. This means that the user can move the mouse to an extreme so that the edge and past is shown in the visible area. Here is the script for the mouse action so far:

var midX = 520;
var midY = 350;
var scaleX = -0.2;
var scaleY = -0.2;
onMouseMove = function(){
bg_mc._x = midX + (_xmouse-midX)*scaleX;
bg_mc._y = midY + (_ymouse-midY)*scaleY;
}

I would be very grateful if anyone can guide me to the actions needed to stop the mouseMove action from continuing to move the image when it reaches it's edge. Also, the registration point is currently in the immediate centre of the image.

Thank you.

Setting Input Field Restrictions.
without using a text box component, is it possible to add restrictions to a basic input field?

Basically I have this input field and I would like to restrict the value to be >= 1000. So when a user enters a number, it must be between 1000-100,000.

Also how do I set a minimum and maximum number of characters for the field?

Any help would be greatly appreciated.

Thanks in advance.

Setting Input Field Restrictions.
without using a text box component, is it possible to add restrictions to a basic input field?

Basically I have this input field and I would like to restrict the value to be >= 1000. So when a user enters a number, it must be between 1000-100,000.

Also how do I set a minimum and maximum number of characters for the field?

Any help would be greatly appreciated.

Thanks in advance.

Setting Restrictions On Mouse Follow Buttons
how can i make a MC follow the mouse, but only follow the mouse vertically, not horizontally? like stay wherever i stick it horizontally

HELP With Opening New Browswer Window With Size Restrictions
HELP! I have a button which I want to open a new browser window to play a swf file. The code i used was
on(release){
getURL("cwismer.swf","_blank");
}

that works, but i want to limit the dimensions of the browswer window it opens to 800 pixels by 600 pixels. right now it opens in to a giant screen. to get a better idea, please go to www.codiwismer.com, click enter, click portfolio, and then click on number 17. you will see that the dimensions of the window it opens show objects that are moved off the stage that i want to stay hidden. please help me!!!

Restrictions On Calling Functions Defined In Symbols?
I'm calling a function from the _root timeline which is defined within a child symbol. However the function does not execute either as an absolute call to the local function, or if the function is defined as a global.

What are the restrictions on the visibility / access to functions within symbols in Flash, and can a symbol's functions & data be accessible from a parent?

My specific problem is that I'm trying to set the attributes of dynamic text fields from the _root timeline, e.g.

_root.main.content_boxes.page_number.text = page_number;

However this does not work, and the attribute can only be set from the content_boxes symbol itself or from a child. However I can read attributes of _root.main.content_boxes.page_number from the _root timeline; just not set them.

Therefore I'm trying to define a SetPageContent(); function within the content_boxes symbol to set the attributes based on a global variable, e.g. page_number.

However this function will not execute from the _root timeline, either as an absolute call to _root.main.content_boxes.SetPageContent(); or if the SetPageContent function is defined as a global function. The function does run if it is called locally, or a from a child symbol.

MovieClip Movement With Irregular Shaped Boundary Restrictions
Hi,

I'm just wondering how to allow a user to move an object around the screen with the keyboard but only within a certain boundary which is not just a basic square or circle. The boundary needs to be some kind of irregular shape or polygon. I'm thinking this sounds like advanced hit testing?

Let me know if there are any good tutorials on this or if you are uber good at this yourself, feel free to speil about it!

icekube12jr

Eliminating Security Restrictions In Internet Explorer When Viewing Flash Movies?
Hello everyone,

I'm looking for a bit of advice concerning my flash animation....

I am very new to using Flash, but have managed to make an animation, and I'm using Macromedia Dreamweaver to make my website.

I have tried the "Insert>Media>Flash" and "Insert>Media>Shockwave" in Dreamweaver to get my flash animation into my website.

However, when I try to preview my .htm file, Internet Explorer v6 brings up a message below the Navigation bar saying: "to help protect your security, Internet Explorer has restricted this file..."

I can click this prompt and allow the animation to be shown, but IE does not do this with other websites' flash animations, and I would prefer if people looking at my website did not see this message, as they might think im trying to send them a virus.

How do I go about by-passing this problem? There must be a way round it as I have seen loads of flash animations without this prompt showing. I am too inexperienced to know where to start though.

Any input would be greatfully appreciated,
Thanks in advance,
Stew

(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

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?!

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???

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???

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?

How To Make A Drag'n'drop Change Mid Drag?
Help! I already know the script to make a Movie Clip drag and droppable.
But how do I make it switch to a different Movie Clip in the middle of being dragged?
Please please help.

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 ?

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

Drag & Drop - "if" Drag's = Drops Script
HELP! I don't know a lot about flash script!

I have created a drag and drop. I want to make the users complete the drag and drop before they can move on. I want to include a script that checks to see if all items are in the correct boxes then "gotoandplay" the next frame where the navigation is active.

I have attached the drag and drop. Here's what I want to write (just need help writing it correctly):

IF
drag1 = drop1
drag2 = drop2
drag3 = drop3
drag4 = drop4
drag5 = drop5
drag6 = drop6
then gotoandplay frame2
If not, keep checking

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!

Drag Abd Drop, Rollover When Drag Is Over Drop Target?
Hi, im using Flash MX 2004.

I am building a drag and drop, and I have a MC that can be dragged around the stage. The trouble im having is trying to make the drop location do something when i drag the MC over/off it.

I have the following code which works.

objectToDrag.onMouseMove = function() {
if ((objectToDrag.hitTest(dropper)) && (component._beingDragged == true)) {
dropper._alpha = 50;
temp++;
trace("working"+temp);
}
}

This will make the clip i am dragging the draggable MC over change alpha, but for the life of me I cant figure out how to get the alpha to change BACK, after the draggable MC is taken away from the 'dropper'.

Is there a better way that hitTest??

Cheerz,
Dwayne

On Press Start Drag, On Press Stop Drag. How?
Hello i have an object that i want to drag and drop with the same event.

Something like on press start drag and on press again stop drag.

Anyone can help me?

I'm sure it's pretty simple with and if and else statment but i can't find how to do that...

The best i have done so far was this:




ActionScript Code:
on (press) {

startDrag(this);

}

on (release) {

stopDrag();

}

But i want to on press start drag then on press again stop drag.

anyone can help?



thanks

On Press Start Drag, On Press Stop Drag. How?
Hello i have an object that i want to drag and drop with the same event.
Something like on press start drag and on press again stop drag.
Anyone can help me?
I'm sure it's pretty simple with and if and else statment but i can't find how to do that...
The best i have done so far was this:


Code:
on (press) {
startDrag(this);
}
on (release) {
stopDrag();
}
But i want to on press start drag then on press again stop drag.
anyone can help?

thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved