Solved

How to make a movie clip draggable?

Posted on 2002-05-03
9
168 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
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Array is not working ( AS2 ) 4 152
camtasia alternative that can record 3 hours video plus audio 24 116
Adobe Flash Player ActionScript error 6 64
Running Mp4 or Flash Video 1 115
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

772 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