Solved

How to make a movie clip draggable?

Posted on 2002-05-03
9
172 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 150 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

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!

Question has a verified solution.

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

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
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…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…

728 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