Solved

How to make a movie clip draggable?

Posted on 2002-05-03
9
166 Views
Last Modified: 2010-04-03
Hi all,
Please help. I am trying to make a movie clip draggable.  What I should specify in the action script window for my movie clip?

Also, I have another question.  I want to open a text document from Flash.  Say, the flash movie will be played on a harddrive (not online) and I have a text file, or a .doc file located on  my computer.  Is there a way I can open the file and launch Word for example? I don't want to open the file in flash but to open it from Flash.

Thanks.

0
Comment
Question by:cyberspy
  • 5
  • 4
9 Comments
 
LVL 6

Accepted Solution

by:
rootdir earned 150 total points
Comment Utility
Simple

Suppose you wanted drag movie "myMovie".

1. create button called "myButton"
2. Get in movie "myMovie" stage.

then write following code for button "myButton"

on (press) {
    startDrag (myMovie);
}
on (release, releaseOutside) {
    stopDrag ();
}

Get "myMovie" movie on main stage. Give instance name same as "myMovie".

That's it. You will get what you are looking for

Cheers
RootDir
0
 
LVL 6

Expert Comment

by:rootdir
Comment Utility
I have created example for you post your email I will send it to u.

Cheers
RootDir
0
 
LVL 1

Author Comment

by:cyberspy
Comment Utility
RootDir,

Thanks for your help.  I wasn't sure if I needed a button in it and I was trying to make it work with onClipEvent.  But it works now.
Also, I edited my question and added some points, maybe you can answer the second part for me as well?
Also, for the draggable clip, there's an option to specify for  "constrain to recrangle" and there's top, bottom, left and right.  How do these numbers work? I tried to specify them but not much changed.  Also I don't want the movie clip to be dragged outside of my main movie stage and i wanted to specify it somehow.  Can that be done?
Thanks again.

0
 
LVL 1

Author Comment

by:cyberspy
Comment Utility
RootDir,

Please disregard the other part of the question regarding the specifications for "constraining to rectange", I figured that one out.  I just need to know the other part regarding the text file.  Thanks.

0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 6

Expert Comment

by:rootdir
Comment Utility
cyberspy,

Here is good example from macromedia site for drag movie

http://www.macromedia.com/support/flash/action_scripts/nesting_movies/index.html

try to move some of those boxes and see the magic.

for your second question -

Keep in mind that this below tech. only works in desktop version. not on internet. If you want to do it on internet you have to consider iis security in mind.

simple way you have to create batch file and call it from flash. So that whatever file you wanted to call it will open with associated program.

You have to call batch file with "fscommand" function and "exec" parameter.

on (release)
{
     fscommand ("exec", "start\yourbatchfile.bat");
}

See this tech. depends upon on which platform you are running your flash movie.

See this example for your further ref.

http://www.actionscripts.org/tutorials/beginner/exec_files/index.shtml

they have shown how commands are different from win95,98 to win2000. You have to play with these commands. It is because of different commands for different microsoft operating systems.

Otherwise you have create seperate vb application/exe which take file name as parameter and open that file for you.

I think this will help you lot. If you have any questions post them.

Two questions for 100 pts.? Just kidding

Cheers,

RootDir
0
 
LVL 1

Author Comment

by:cyberspy
Comment Utility
I'm not sure I got all of this.  How do I create a batch file and how does it work? What if I want to use it on Mac? does it work only for windows?
thanks, I added some points for you.

the draggable movie I figure out, don't worry about that one.
0
 
LVL 6

Expert Comment

by:rootdir
Comment Utility
Yep this will work on windows. I think batch files are ava. in unix but I am not sure in Mac.

Do you use Mac or Windows?

I will fig. is batch file works on Mac?

RootDir
0
 
LVL 6

Expert Comment

by:rootdir
Comment Utility
I think,

 if you are using windows then you have to create batch file(.bat).

 if you are using Unix then you have to create .batch file

 if you are using mac then you have to create .mac file

 Which will open whatever file you need to open and call resp. .bat or .batch or .mac file from flash that's it.
0
 
LVL 1

Author Comment

by:cyberspy
Comment Utility
Thanks for your help!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now