Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to make a movie clip draggable?

Posted on 2002-05-03
9
Medium Priority
?
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 6

Accepted Solution

by:
rootdir earned 600 total points
ID: 6989238
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
ID: 6989245
I have created example for you post your email I will send it to u.

Cheers
RootDir
0
 
LVL 1

Author Comment

by:cyberspy
ID: 6989299
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:cyberspy
ID: 6989529
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
 
LVL 6

Expert Comment

by:rootdir
ID: 6989917
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
ID: 6990090
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
ID: 6990488
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
ID: 6990493
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
ID: 6991525
Thanks for your help!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
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…
The goal of the tutorial is to teach the user how to how to record live broadcast.
Suggested Courses

604 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