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








Locking With Drag


I didn't exactly do this yet, but I am goin to need to know how to do this. If I have an MC that can be dragged and dropped, how do I make it so if you are close enough to a "slot" it will lock in to that slot? any help is appreciated.thanks!




FlashKit > Flash Help > Flash ActionScript
Posted on: 06-05-2002, 10:59 PM


View Complete Forum Thread with Replies

Sponsored Links:

[MX04] Drag And Drop- Locking Object Into Center Of Target...
Hello all,
New member and relatively new Flash user. I created a drag and drop in Flash MX 2004, and I'm trying to find script that will lock the object into the center of the target when it is dragged over, sort of like a magnet effect. Here is the script I currently have on each object:


on(press) {
startDrag(this);
_root.reply.text="";
xstart = this._x;
ystart = this._y;
}

on(release) {
stopDrag();
if (this._droptarget == "/pinottarget") {
_root.reply.text="Correct!";
this.enabled = false;
_root.counter++;
}

else{
_root.reply.text="No, keep trying!";
this._x = xstart;
this._y = ystart;
}
}



If anybody can help me out with the correct script to do what I'm trying to do, I would greatly appreciate it. Attached is the source file. Thanks.

Lee

View Replies !    View Related
Locking Down A PC?
If I wanted to make a Flash ap that was to run on a PC but I didnt want the user to be able to do anything else, how would I do this?

Its for a demonstration where users will be able to have a go on the Flash ap using the mouse but not be able to access the OS. No ctrl+alt+delete, alt+tab etc.

Can this be done?

Thanks.

View Replies !    View Related
Locking .swf?
Is there a way to lock an swf so the user cannot maximize it?

View Replies !    View Related
Locking Swf Help
how do i lock my swf i did it once by accident and i have no idea how...

plz help i'm sure its simple

View Replies !    View Related
IP Locking In Flash
is it possible to lock an swf to a certain IP address so that when it is viewed on a different IP address it won't run?

View Replies !    View Related
IP Address Locking
what i mean about ip address locking is that can i do a script in flash to lock on a certain ip so that my swf would only run on a server with my specified ip address?

View Replies !    View Related
Locking A Button
I need to lock a button in the down layer.
But _invisible = false don't works because I'm using this in other button at top frame.

Why this ocours and what I can do???

View Replies !    View Related
Mailto Is Locking
i have placed a basic mailto link on a button i have made

on(release){
getURL("mailto:me@me.com")
}

all is well when its clicked, outlook pops up and the everything seems fine. however once i close outlook and i am back at my site any link i click will briefly flash up the correct page before returning to the page with the email link on it

any ideas?? its been driving me round the bend for a while now.

thanks

View Replies !    View Related
Locking The Keyboard
Hey all, I was Just wondering-- If there was a way to lock the keyboard. Thanks for any help I can Get.

View Replies !    View Related
Locking Buttons
Hi,

I've got an menu system which when you click on one of the buttons, it runs an animation to change the header of the page to the one you've just clicked. The only thing is that if you click on the button again during the animation, then it reverts back to the frame it started on and stops.

Does anyone know of a way of locking buttons for the duration of my animations?

Ta..

View Replies !    View Related
Video Locking Up
My video runs fine until the ending credits. There is a character playing a guitar and a character playing the drums to the rythm of the song. The guitarist is also singing the lyrics. It sort of runs ok when I run it in flash on the timeline. But as it progresses it starts slowing down (the animation that is). The music runs fine but the frame rate becomes choppy. This is only worse if tested outside flash. I've tried merging layers but it didnt really help. I also cut the credits from scrolling to stationary but that only helped a little bit. Are there any tricks to helping flash run better, or did I not check/click something. Help is greatly appreciated. I apologise if this is an unadvanced question that could have been found via searching, but I don't have the time to look right now and this is my first movie. All replies are appreciated, thanks.

View Replies !    View Related
Locking SWF Files
How can i protect my flash swf porfolio from decompilers or any other similar apps that can see inside my work? is there any kind of protection given in FlashMX for this?

View Replies !    View Related
Locking To The Mouse
hi,

Catbert (the genius) gave me a fla called crosshair (which helped me greatly) but when i try to paste the action script for the crosshair onto a new object it says there is an error in the script.

its wierd because it works fine on the crooshair.

any help would be greatly appricated

bye.

View Replies !    View Related
Locking The Keyboard.
Hi. I am definitely not a newb at Flash, but this is one thing I never learned how to do:
How do you lock the keyboard (AS2)?
and
is it possible to lock the mouse (if so how?, AS2)?

Thanks.
Sportzguy933

View Replies !    View Related
Locking The Keyboard
Hi.
How do you lock the keyboard (AS2/AS1)?
and
is it possible to lock the mouse (if so how?, AS2/AS1)?

Thanks.
Sportzguy933

View Replies !    View Related
Locking Window
Hey all. Just one question. How do I lock the .swf window so that a user cannot resize it and see things that they aren't supposed to see?

Thanks in advance!

View Replies !    View Related
PLEASE HELP ME Flash Locking Up
I've made plenty of flash games before and I've never seen this problem happen.
I'm working on a game with similar workings to GTA1, as in your in a car and u drive around birds eye view.

The issue I'm having is that I have went to the effort of making flash not 'lag'/slow down so the frame rate stays pretty good. However for some reason after holding down a button or 2 (eg. up to drive, left to turn, ect) flash locks up. The program runs normal, framerate is normal, but any interaction is locked up. When this happens my car just keeps driving.

I put up a display to show what buttons are being pressed and sure enough flash is stuck thinking im pressing keys when im not. I also can't close flash until it returns to normal.

Obviously this is bad and I was hoping someone would know why flash is doing this.
Can someone please help me.

View Replies !    View Related
[CS3] Locking The X Axis
hi all

i'm following a platform game tutorial at the mo but the camera tracks with the character along the x axis but not the y axis.

i want my game to scroll up with the character and lock the x axis in place because as it is you can jump off the top of the screen and disappear while you can also walk off to the side and just see blank non-game screen

thanks

View Replies !    View Related
Locking Distance Between 2 Mc's?
I have 5 movieclips on a stage, and i want the distance between each movieclip to keep the same (only _x).

So that if was to move one movieclip or expand a mc, then the others would move across accordingly.

Also how would i go about setting the width parameter in which the movieclips can move it, so that if they were to move to the end of the stage, they wouldn't go off the stage?

View Replies !    View Related
Tweens Locking Up?
I'm working on a new website for a client....when the movie loads, there are several tweens that bring in the Navigation, Logo and some other graphics onto the stage.

It works great when I test locally, and it works great on the web server with IE...but when I view it on the web server with Firefox or Safari, some of the tween "lock up"....basically the animations don't finish...they'll start and then the object just stops partway through the tween and never gets to the position it should be in.

Again, it looks great in IE, but not FF or Safari....anyone know why this might happen?

View Replies !    View Related
Locking Guides
Is there a way to lock the guides so that they will be visible on all the scenes
?

View Replies !    View Related
Locking The Y Axis...
hi,
I am trying to get a movie clip to stick to the mouse, but only move along the x axis. i also want to make it so that when it comes into contact with a 'wall' it stops and goes to a different screen where an animation will play.

plz help all u can.

Rob,

P.S. attached is the current file...

View Replies !    View Related
About Locking _level0
I have two file..

in file1:- the code writing in frame 5 "_level0.gotoAndPlay(1);"
in file2:- i m loading file1, using "mc1.loadMovie("file1.swf");" and put the code "mc1._lockroot=true;" for locking.

but this code is working only in MovieClip or _root not in _level's.

any one can help me for locking _level0 or _level1......

it's very big problem for me..

please help me

View Replies !    View Related
Locking Images
Hello there.

Having a little problem:
i'm in the middle of building this site here:

www.theplayground.net.au/cc

The problem is that when you resize the browser, the navagation runs over the logo (christopherchris: top right corner) and the contact details runs over and looks rather ugly. Is there a way to keep everything centered (as it is) up until a certain point (e.g maybe 100 pixels x_right of the logo) thus preventing this horrible mess!

If you have any ideas, let me know!

Thanks for your time

Kindest

Ben

View Replies !    View Related
Domain Locking In AS3?
Is it still possible to do domain locking in AS3?

I tried the following:


Code:
var topUrl:String = (root.loaderInfo.url);
But it keeps giving me the url of the swf file instead of the page that it's being loaded into.

Is there a new way of doing it? Thanks.

View Replies !    View Related
Locking Variables?
Is there a way to lock variables? FOr example I give a variable a value and then lock it so that it wont be able to change. Any ideas?

View Replies !    View Related
Locking Controls
This is a little bit of a different situation. I am developing in AS3 using Flex... I know it is different than Flash, but thought you guys might be able to help out.

Here is the situation:
I have a canvas that allows my users to draw and write on it. They can do what ever they want on the canvas. The problem is that if the user clicks and holds down the mouse button, goes off the control, releases the mouse button and comes back.... it keeps drawing. What I want to do is make it so that if the mouse button is clicked, the user can not go outside the bounds of the control.

Is this possible? if so, can you point me in the right direction?

View Replies !    View Related
Pixel Locking?
Is there any way of making it so flash doesn't place any objects or text fields on the decimals of pixels? I want it so no matter what I do, everything is placed on a whole pixel (x: 9.0 y: 153.0). i dont want to have to go through each object and change the coordinates to whole numbers. Know what I mean? i know there is "snap to pixels" which helps... but if you copy/cut and paste an object, sometimes it will land on a coordinate with a decimal.

View Replies !    View Related
AS3 - Sending .fla But Locking The AS
So I developed this flash piece that loads 1-10 images along with each one having a header, summary and related links. It keeps cycling through the images unless you press stop.

Well, I have to send it to the the client so just incase they need to change the skin they can and republish and upload.

Well here is the question, How can I make it so that they have access to move the swf around any way they want as far as changing button graphics and x and y coordinates of the buttons and images but cannot mess with the AS code at all?

View Replies !    View Related
Locking Images/nav
Hello there.

Having a little problem:
i'm in the middle of building this site here:

http://www.theplayground.net.au/cc

The problem is that when you resize the browser, the navagation runs over the logo (christopherchris: top right corner) and the contact details runs over and looks rather ugly. Is there a way to keep everything centered (as it is) up until a certain point (e.g maybe 100 pixels x_right of the logo) thus preventing this horrible mess!

If you have any ideas, let me know!

Thanks for your time

Kindest

Ben

View Replies !    View Related
Flash Is Locking Up
I'm using MX 2004 Professional.

For some unknwon reason my .fla is suddenly locking up. I open the .fla and I can select 1 thing - but then I can't select anything else. If I press delete nothing happens except that Flash closes down and boots me to the desktop. Same thing happens if I try to delete from the library.

The Hide / Show layer toggles also don't work.

I've tried copy and poasting the frames to a new .fla but the problems are still there.

Anyone know what would cause this?

View Replies !    View Related
Locking Coll Mc With Mouse?
can somebody please tell me how can we make the mc which is locked with the mouse,like the one in http://www.djrummy.com/users/djrummy/one.swf , i tried making a mc and puting a frame action,truestartDrag ("mcNmae", true);
but it dosnt play like the one in cell-loc.I know their must be some actionscripting in it ,can somebody elaborate ??
thanx!

View Replies !    View Related
Locking Screen Size + More. More More :)
Hello everyone. As my first post here, I'd like to really thank everyone who gives the new people a hand, and not hoarding all the information to themselves. Thanks!

On to the questions:

1). when I exported my flash to a .EXE file, by default, the 'Loop' option is checked under the CONTROL menu. How can I change this so that the movie does not loop automatically when the user runs the program?

2. Secondly, I would like to be able to lock the window size. Currently when playing the movie, the user is able to resize the window and see 'outside' of the movie... ie: the white background (whereas all they should be seeing is a black background).

3. When my movie is running, the default window size that opens is too small, and the user has to drag the bottom part of the window downwards (to extend the window larger) in order to see the whole movie. When the movie opens in it's default window size, the user cannot see the text on the bottom of the screen. However, when they make the movie fullscreen, everything is normal. Ideas?

Once again, I really thank you for all your help! You're the greatest!
[Edited by hca_god on 01-20-2002 at 11:45 PM]

View Replies !    View Related
Locking An Object At A Certain Point
I'm very new to Flash, just got it (Flash 5) this weekend, and trying to make my first animation. I'm trying to make it look like a dude playing a guitar, but it looks kind of strange:

http://home.no.net/skenzy/flash/Guitardude.swf

Pay attention to his right arm. I would like to "lock" his shoulder, and only his shoulder, so that it would stay in place, and not move around from frame to frame. That way it would probably look a bit more realistic.

Is there any way to do this?
All help would be much appreciated.

View Replies !    View Related
GetTimer() Locking Up System, WHY?
Hey all, I'm writing a simple little ticker with dynamic buttons, when the ticker is centered I use this script:

if ((difference<2) && (difference>-2)) {
var startTime = getTimer() + 3000;
while (getTimer() < startTime){
_root.main._y = _root.main._y;
}
}

The ticker works and stops in the correct loaction for three seconds, the problem is that it locks up the system until it is done counting, does anyone have any ideas on how to resolve this lock up.

satchm0

View Replies !    View Related
Locking Window Size
hello.
how can i lock the window size of an exe?
ex. they cannot make the window any bigger/smaller..
thanks
~chika.

View Replies !    View Related
Locking Mouse To Button?
Is there a way, so that when the user clicks, the mouse gets locked to the button, until they release?

View Replies !    View Related
Locking Window Sizes
How might I go about making it so that when my Flash window pops up, its size is unalterable?

Also could this be applied so that on my HTML page, the embedded Flash presentation is of a fixed size?

Thanks!

View Replies !    View Related
Locking/resizing Window
How can i get my flash site to open in a window that is exactly the same size, can't be resized and does this in both netscape and internet explorer? I can lock the window off at 800x600 which is the size of my movie, but this is unpredictable because the person viewing it may/maynot have the Address/navigation bars up.

Any advice?

is there an extension for dreamweaver? Where can i get it?

Thanks in advance

View Replies !    View Related
Locking A Flash Page?
I am creating a Flash based website, but i trying to find out how to lock the top part of the window so the image stays still while the user scrolls the window down to read the pages content. Can someone please give me some advise?

View Replies !    View Related
Locking Flash Files
I have got a few flash files on my website, however, when right-clicked with a mouse it allows the user to stop, play, loop etc. Is there a way I can stop this facility happening.

Smiley......slowly getting there

View Replies !    View Related
Locking One Side Of An Animation
hello all

First off im not even sure if this can be done with a tween or automatic form, but here goes

i want to make a movie where there is a beam of light that starts from the corner and moves about the main stage. the beem would change based off the angle that it is at to the stage, and the location of the orgin of the beam must never move. i hope that is clear...if not please ask me..

is this possible? i can move the beam around the stage with motion guides but the orgin of the beam also moves...

any ideas would be great...

and thank you in advanced for the help

sincerely

questioned.

View Replies !    View Related
Locking Window Size On .swf And .exe
I'm a super shiny newb at this so I apologize for the simple queston but I figure this is the place for it.

I am trying to lock the window size of a published .exe or .swf

I've looked up the question here and it seems locking with JavaScript is the answer if publishing for HTML but that is not my aim.

I need to be able to publish .exe for CDs or hand off a .swf for someone else to post and I need them to be as unalterable as possible.

I'm using MX 2004 if that makes a difference.

Thank you in advance. I've only been doing Flash for 2 weeks and I already like you people.

View Replies !    View Related
Locking The Actions Panel
I've successfully locked the Actions panel on top of the Property Inspector panel on my PC, but have been having trouble on my Mac. It always "floats". Anybody with a solution to this?

I'm on Flash MX, by the way.

Thanks!

View Replies !    View Related
Character With Collision Locking Up
I am trying to create an object(Simme_Coll_MC) that is draggable but stays within the space of another object(Path_MC). I want to be able to control this object and not be able to pull it out of the Path_MC movie clip at all. I know that hitTest will be one of the functions to use but what about knowing the space of the path object? I got this so far I can move the character but the collision object is capable of moving out of the path and then it locks up. Any help is appreciated. Thanks




PHP Code:



onClipEvent (enterFrame)
{
var b = _root.Path_MC.getBounds(this);

//if registration point is in the center of draggable object

//_root.Simme_MC.Simme_Coll_MC(false, b.xMin+this._width/2, b.yMin+this._height/2, b.xMax-this._width/2, b.yMax-this._height/2);

//this is the collision code
if (this.Simme_Coll_MC.hitTest(_root.Couch_MC))
{
    trace("hitting couch!!");
    stop();
    }
    if (this.Simme_Coll_MC.hitTest(_root.Plant_MC))
{
    trace("hitting plant!!");
    stop();
    }
    
//Collision with path    
//checking if crossing path
    
if (this.Simme_Coll_MC.hitTest(_root.Path_MC))
{
//this is the collision code
trace("in Path!!");

    //dircetional left right and scalar
if (Key.isDown(Key.RIGHT))
{
this._x = this._x+14;
_root.Simme_MC._xscale=+100
gotoAndStop(2);
}
if (Key.isDown(Key.LEFT))
{
  _root.Simme_MC._xscale=-100
  this._x  = this._x-14
  gotoAndStop(2);
  
}

// up and down directional
  if (Key.isDown(Key.UP))
{
this._y = this._y-=5;
gotoAndStop(2);
}
  if (Key.isDown(Key.DOWN))
{
this._y = this._y+=5;
gotoAndStop(2);
}


//  attack
if (Key.isDown(Key.SPACE))
{
     gotoAndStop(4);
     }
    stop();
    }else
    {
        trace("out of path");
        }

View Replies !    View Related
Locking An Input Text Box
How can you make an input text box read-only once someone has typed something into it? (i.e. they are unable to change the contents)

textboxName.type = "dynamic"; or textboxName.selectable = false; dont seem to work in the following button code ("entry" is the variable name of the input text box):

on (release)
{
if ((entry == "F") | (entry == "f"))
{
entry.type = "dynamic";
correctletters ++;

if (correctletters == 2)
{
completedmessage = "CONGRATULATIONS!";
}
}

else
{
entry = "";
errormessage = "Sorry wrong letter, try again!";
timer = setInterval(wait, 3000);
}
}

on (keyPress "<Enter>")
{
if ((entry == "F") | (entry == "f"))
{
entry.type = "dynamic";
correctletters ++;

if (correctletters == 2)
{
completedmessage = "CONGRATULATIONS!";
}
}

else
{
entry = "";
errormessage = "Sorry wrong letter, try again!";
timer = setInterval(wait, 3000);
}
}

What else can I do?

View Replies !    View Related
Locking Sound Paths
Hi,

I have a swf file containing mp3's that are attached when called on play. This swf file with the audio ultimately loads into another swf file when called.

Now when the swf file with the audio is played directly everything is fine. I do have a lock root too on this file. So the navigation is working. Is there something similar for sound?

When this file is played loaded and played thorugh the swf file holding it, it only is navigable and does not play the songs. What is wrong with my script? I think it is a pathing issue but am not sure this is it below

Master swf file containg the swf file with the audio that is loaded into it with loadmovie action.

stop();
loadMovie("home_content.swf", _root.holder_mc);

Swf file containing the audio and buttons.


stop();

loop_sound = new Sound();
loop_sound.attachSound("exit.mp3");

as.onRelease = function () {
stopAllSounds();
nextFrame();
loop_sound.attachSound("exit.mp3");
loop_sound.start();

}

this one is housed in a movie clip that is on the main timeline and has an instance name of exit. The master swf has a movie clip file that is loads into called holder_mc. I tried the path of
"_root.holder_mc.exit.buttonname.OnRelease()" and it doesn't work. Any input would be helpful. If needed I can send the fla files.

thanks

View Replies !    View Related
Locking An Embeded SWF To A Domain
I have currently locked a flash site, due to all content being external, to its domain to prevent naughty little individuals from stealing it

this is done by testing something similiar to the following:


ActionScript Code:
(this.loaderInfo.url == "domainNameHere") ? proceed(): breakTheirPC()

this works for a SWF at root level however when you embed a SWF within a swf and run the above for the embeded swf the loaderInfo.url returns null..



Anyone know why as I dont quite understand

View Replies !    View Related
Is This Site Locking Up During The Load? Plz Let Me Know
The site that is having a hard time loading is located at:

www.johncliffordtaylor.com/pat
(Flash player 6)

www.johncliffordtaylor.com/pat/test.html
(Flash player 9)

But here is the kicker I was talking a co-work and they said that both of them were loading fine on their computer.

I've tried it on the 2 computers I can access the site as its bogging down on both 1/2 way loaded, so I don't think it’s a PC thing. The size of the flash site is only 400 kb so it’s also not a bandwidth issue.

I've tried deleting my internet history. I'm not sure if it’s a sever issue or something else is going on but any suggestion as to what might be going to make this flash site bog down 1/2 way through the load would be great thx.

John

View Replies !    View Related
Locking Movie Clips Together?
I have 50 movie clips containing images. what I need is that when I drag one movie clip, they all move at the same time and the same way as if I was moving all of them. I can't put them in a container movie clip because I need to know their _x and _y positions at all time.

Can anyone help?

Thank You! :)

View Replies !    View Related
CSS Locking Input Textfield
Hey guys,
I want to style input text, so i created a stylesheet.
I made a input textfield, loaded the external stylesheet, defined the textfields stylesheet, and boom it works.
Except, i cant type anythin into the text field. Which is a problem. Attatched is a example of what i am experiencing. Thanks!

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved