Script jumps to another script

Hello all,
Here is a link if it may help:
http://academic.algonquincollege.com/students/fabe0002/Threads2.swf
Basis of this project:
User has six selected answers, but only one is right. User
drags answer to answer box, if wrong they are told so and only have
one more chance until actual answer is correct.
Script Basis:
Movie clips are on stage and all scripts are on the frame.
Problem that comes up: (traces are placed to locate problem)
When one clip is dragged and released the script jumps from
one script to the next an reverse. So the result is after the first
answer is attempted and is wrong, the next clip only has to be
touched or dragged a little which triggers and incorrect response.
Here are two of the sample movie clip scripts and the trace results
below: This is a ponderer:
selectionOne.onPress = function() {
trace("one");
this.swapDepths(1000);
this.startDrag (true);
selectionTwo.onPress = function() {
trace("two");
this.swapDepths(1000);
this.startDrag (true);
selectionOne.onMouseUp = function() {
trace("one mouseUp");
this.stopDrag();
this._x = 229.7;
this._y = 263.1;
if (selectionOne._droptarget == "/tg01") {
_root.rFLD="Please try again.";
_global.shortAnswer = _global.shortAnswer+1;
//trace("second" + _global.shortAnswer);
if (_global.shortAnswer == 2) {
trace("selectionOne");
_root.rFLD="The correct answer is";
_root.varAnswer=_global.realAnswer;
_global.shortAnswer= 0;
play();
this.swapDepths(this.depth);
this._x = 229.7;
this._y = 263.1;
selectionTwo.onMouseUp = function() {
trace("two mouseUp");
this.stopDrag();
this._x = 88.5;
this._y = 323.1;
if (selectionTwo._droptarget == "/tg01") {
_root.rFLD="Please try again.";
_global.shortAnswer = _global.shortAnswer+1;
if (_global.shortAnswer == 2) {
trace("selectionTwo");
_root.rFLD="The correct answer is";
_root.varAnswer=_global.realAnswer;
_global.shortAnswer= 0;
play();
this.swapDepths(this.depth);
this._x = 88.5;
this._y = 323.1;
THE TRACE RESULTS When one is dragged and then the other:
one
one mouseUp
two mouseUp
two
two mouseUp
one mouseUp
This has been implemented only on the first question. If
anyone has an answer, I will greatly appreciate it.

The onMouseUp event is too global for what you need, I think.
Try changing them to onRelease. Also, to make sure that they do
register you should use the following:
selectionOne.onRelease = selectionOne.onReleaseOutside =
function() ....
This will help make sure that the releasing the draggable
object is captured. Just so you know, when I made this change and
tested it I got the following trace:
one
one mouseUp
two
two mouseUp
Which is what I think you expect, right?
Tim

Similar Messages

  • How can destroy Java Plug - in when i jump to another page without Applet

    When I jump to another HTML page, that not include <Applet> </Applet> tag, the Java Plug-in does not exit and use system's resource. I don't want it make my computer run slow then I want sutdown the Java Plug-in when I stop the page, that have an Applet.

    Hi dekassequi:
    Sorry if I misunderstood the problem......I've never tried swing set because it requires the JVM plugin. All my applets are non-swing and I've noticed that frequently when I exited the browser, it would be stuck in a never-never land requiring ALT-CTRL-DEL to end the browser's task. By overriding the destroy a the call to system.exit seems to have solved my problem -- if there is any error message in the system console, it is not noticeable because it disappeared instantenousely when the browser's own JVM is used.... Besides, destroy is the last thing an applet does anyway....without looking at Java source code, I can only surmise that that's what it does
    As a matter of fact, I've just tried to write some stupid swing applet but I've noticed that one cannot really script an applet that requires a Sun JVM. Here is a link, perhaps you can take a quick look and see if I'm doing something wrong.
    http://home.attbi.com/~aokabc/test/test2.htm
    BTW, I did notice late last night that overriding the destroy method in an applet that requires a JVM plugin does give an error message in the system console which takes a bit longer to close but you know what, at least it got rid of the console afterward -- otherwise, the console just sit in the tray and ALT-CTRL-DEL can't even get rid of it. In the mean time, I'll simply remove the system.exist(0) and leave a skeleton destroy method and see if the JVM console still sit in the system tray.
    Regards,
    V.V.

  • After selecting an image in Library mode (grid view), my selection of image jumps to another image.

    Through several versions of Lightroom, I have encountered this problem.  I choose an image in Library mode while in Grid view and the image jumps to another that I have not chosen.  This happens about 75% of the time.  Does anyone else have this problem?  Does anyone know of a remedy.  I am using a Mac.

    HMSieg wrote:
    I am using a Mac.  I followed the platform specific instructions to find the preferences file but it is not there.  I also did a global search of my computer and the file did not show up.
    You are using the Option key to access the Library under the Go finder Menu?
    Click in the Go menu the hold the Option key and you will see Library appear, otherwise is is hidden.

  • Layer palette issue. I choose a layer and when I use move tool on that layer PSCC jumps to another layer

    I am Using Photoshop CC 14.2.1x32. When I choose a layer in the layers palette and then use the move tool to re-position an element on that layer, PS forces a jump to another layer. The only way I can re-position is by using free transform on the layer I want to work on. What is happening with PS CC? Please help. About to dump CC and go back to CS 6

    You might have been able to change the Auto Select option from the default Group to the usually more user friendly Layer.  It's one heck of a useful feature, so get used to using it if you can.  For instance, if you have a lot of layers, it can make it a lot easier just to find a particular layer in the layers panel.

  • Problem: do something, if jumping in another textfield through tab-key

    hi,
    please, maybe can anybody help me.....
    I've got some textfields (JTextField) in a swing-application. by jumping in another textfield through pressing the tab-key, something should happen.
    I wrote the following code, but it doesn't works ;-(
    textfieldReleaseOf.addKeyListener(new KeyAdapter() {
    public void keyPressed(KeyEvent e) {
    if (e.getKeyCode() == KeyEvent.VK_TAB ) {
    System.out.println("tabspr...................");
    else {
    System.out.println("kein tabspr...................");
    thanks for helping......

    From your problem description it seems that you need to do something not only when the user presses TAB but also if the user switches to some other textfield. Although it could be accomplished using the KeyListener as you have already done, a better way would be to use the FocusListener. You can add a FocusListener to your JComponent (or JTextField) object. It will fire events whenever the user presses tab to move onto the next field and even when the user clicks on the next field using a mouse.

  • Desired web page jumps to another

    When opening a web site, saved about 2 years ago in favorites, it opens but jumps to another web site immediately on completion of loading. What is happening? This does not happen in Firefox.
    The web site saved is: http://www.shipshapecanvas.com/index.php. The web site it jumps to is: http://www.webring.org/hub/greatlakes. The desired target serves the Great Lakes region.
    Thanks
    Geoff

    Geoff...
    Empty your Safari cache. You can do this from the Safari menu bar.

  • After Effects stops rendering when I jump to another application, like a browser

    I'm a long time AE user. I've never seen this issue.
    When I start a composition to fully render, it's fine until I jump to another application and let it work in the background.
    As soon as I click off of AE, I get the "job finished chime" and it shows a completed render up to the point that it was at at the time I jumped off.
    On a side issue, but might be related, AE "auto hides" when I click off to another application, rather than stay on screen.
    I'm working on an iMac with Yosemite 10.10.1 OS.

    AE CS6 and later versions can all run on Yosemite.  Each has its own problems with the OS.  If you haven't updated AE, you need to do so to get the fix for Yosemite.

  • Quiz Skip Button Jump to Another Slide that is not Next slide.

    Is it possible to make the Quiz Skip button jump to another slide besides the next slide? I'm using Captivate 7.
    Basically, I want the quiz slide to exit to another slide that is not the next slide.

    Branch aware is a totally different thing: it makes the quizzing variables dynamically adapting to the questions that are taken by the trainee.
    You are talking about the Skip button, which is puzzling because that button label was changed to Next since version 6. And Branch aware only appeared in 6. Which version are you using? You are talking about shapes so it must be 6 or later.
    Another question: do you allow Review? Because in that case you'll need that Next (Skip) button. http://blog.lilybiri.com/question-question-slides-in-captivate
    You are talking about a 'custom Skip button'? Can you explain, and also what you mean by the rollover shape? If you have a custom button it should be visible on the timeline of the slide, contrary to the default objects on question slides that are embedded and have no separate timeline. Or was the question master slide edited to add a rollover shape to the default Next button?
    Lilybiri

  • Jumps to another song and doesn't play

    I bought this from a friend's mom who won it at work. She had not used it at all. I had a video ipod but it is broken so I downloaded my songs on to this one. When I first downloaded, it didn't capture all my songs. It played at first. Now when I click a song, it jumps to another song and doesn't play at all.
    What should I do now?
    ipod 15gb   Windows XP  

    Hello and welcome......
    Try resetting your iPod, instructions here.
    Carolyn

  • I have downloaded and deleted an album 3 times now because on the playback, every 30-60 secs. it jumps to another song on the album. I have never had this problem before. Thanks !

    I have downloaded and deleted an album 3 times now because on the playback, every 30-60 secs. it jumps to another song on the album. I have never had this problem before. Thanks !

    Try deleting and redownloading again, this time with simultaneous downloads disabled.
    While downloading select Downloads in the left-hand column and make sure Allow Simultaneous Downloads is unchecked.

  • TS1362 Two weeks ago Purchasing 60 songs from iTune store.So Two of them play only half of song and then jumping to another songs.What is could be?Or can i get repair this two downloads?

    Two weeks ago Purchasing 60 songs from iTune store.So Two of them play only half of song and then jumping to another songs.What is could be?Looks like is not been downloaded full.Can i get this two songs to play correct?Many thanks Aleksejs!!!

    If your country's iTunes Store allows you to redownload purchased tracks, I'd delete your current copies of the dodgy tracks and try redownloading fresh copies. For instructions, see the following document:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Otherwise, I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the items that are not playing properly. If you can't see "Report a Problem" next to the items, click the "Report a problem" button. Now click the "Report a Problem" links next to the items.

  • I just upgraded to 9.0.1 and when I use my touch pad to scroll down or up a page the page jumps to another tab. How do I remove 9.0.1?

    I am using a MacBookPro, OS X 10.7.2. I am unable to use the touch pad to scroll without having the page jump to another tab. This is annoying and the only way I can navigate any more is to use the scroll bar on the right side of the page. I would like to remove the most recent upgrade, any ideas on how I can do that?

    When you upgraded, itunes should have put a copy of the itunes library database in a folder named *Previous iTunes Libraries* . If you upgraded itunes today it will show as
    iTunes Library 2010-02-28.itl
    Use these directions to get it back
    http://support.apple.com/kb/TS1967
    Since I am not sure of your setup, look for the "Previous" folder on both your C: and F: drives.

  • When I press the option key on a Mac it jumps to another page

    On my Mac I need to use the "option" key to type accent marks when I am typing in Portuguese, and when I press that key it jumps to another page.

    Go to System Preferences > Accessibility > Keyboard, and untick "Enable Sticky Keys"

  • Is QuickTime Pro able to be programmed in any way to make it so when a vidoe frame is reached it will automatically jump to another frame or a previously marked chapter?

    I currently create interactive videos with Flash that use live person video to ask the viewer questions and allows the viewer to click an answer.
    Depending on "right" or "wrong" the playhead jumps to the appropriate point in the video (all held on local PC not web) to either say "Well done" or "Sorry that's wrong because...". Then it jumps again to the next question in the video - and repeats.
    This video can then be inserted in PC's PowerPoint.
    Now.. a client wants the same thing but to work in keynotes. So No Flash and No Powerpoint.
    Part of the QTPro7 new features says it can be controlled with scripts? I can't find anything to show how or what can be done with this?
    So my question - is can the functionality I have in Flash be created in QTPro with some form of script?
    I know I can create something like it in keynotes using individual clips - but the mention of controlling QTpro with scripts has got me hoping there is a way to treat it like Flash????
    Thanks if you can answer.

    Shut down the computer.
    Plug in the MagSafe power adapter to a power source, connecting it to the Mac if its not already connected.
    On the built-in keyboard, press the (left side) Shift-Control-Option keys and the power button at the same time.
    Release all the keys and the power button at the same time.
    Press the power button to turn on the computer. 
    Note: The LED on the MagSafe power adapter may change states or temporarily turn off when you reset the SMC.

  • Stop video audio when jumping to another label?

    Hey there I have a video with audio (showing within a "videoHolder" object) at one label, but when I click a back button to go back to the main menu at another label, the video disappears but the audio still plays.
    ie the video label is...
    var vid = sym.$("videoHolder");
         vid.html("<video width='600' height='400' controls= 'controls' preload='auto' autoplay='autoplay' poster='video/medicationAlliance.jpg'>" +
    "<source src='video/medicationAlliance.mp4' type='video/mp4' />" +
    "<source src='video/medicationAlliance.webm' type='video/webm' />" +
    "<source src='video/medicationAlliance.ogg' type='video/ogg' />" +
    "</video>");
    whilst the main menu is...
    sym.stop();
    Is there anyway to stop the audio playing at the main menu?
    Thanks in advance.

    I'm having a similar issue...
    a bit of newbee as well..
    i have poster... when you click on it... go to another part of the timeline... The video in the videoholder loads up. I have an action script....this works great...
    // sym.$("name") resolves an Edge Animate element name to a DOM
    // element that can be used with jQuery
    var element = sym.$("stealin2");
    element.html('<video width="715" height="382" \
    src="http://www.richardburnschannel.com/storage/stealinmovieLarge.mov" \
    type="video/mp4" controls="controls" \
    ></video>');
    above the videoholder, I created a graphic box with an x for stopping the video.
    I create a trigger so the when you click on the X the action goes back start location where the videoholder is gone. Thus, back to the poster.  However, the video continues to play.  Here's the trigger i use, which works to get rid of the videoholder but not stopping the audio in the video.
    // play the timeline from the given position (ms or label)
    sym.play("start");
    I've tried a bunch of these solition but no luck..
    rb

Maybe you are looking for

  • Sound driver does not work after reinstalling XP on Tecra M9

    Hi, After lot's of fighting i've given up. It's just been imposible to get my sound card up a running on my TECRA M9 PTM91E, after i decided to give it a clean up by formating the disk entirely. My proceedure goes as follows: 1. Installed WINDOWS XP

  • Problem with my iPhoto prints

    I need someone to treat me like a 4 year old...ha, ha. Please give me detailed instructions on how to fix my issue. I have tried to follow similar posts and I cannot figure it out. Here is my problem: 1) I take pictures w/ my digital camera 2) I impo

  • Old computer to new...

    If I back up my ipod music and reformat my ipod from pc to mac, can I import my playlist or do I have to start all over? What about the music purchased from itunes? I am sure I can find all this in some manual, I just have not gotten around to it yet

  • Default email app header critical problem -- and workaround

    After a bit of research, I found out why email from my Charge was being received by some email clients as garbage.  Check out this link: http://www.google.kg/support/forum/p/Android+Market/thread?tid=1eda730e523366c2&hl=en This has been known for at

  • Printing Report - Urgent please

    Hi All, Can anyone please help me with the following printing problem. I created a report using class cl_gui_list_tree. The report looks like our windows directory stucture. Like directory/sub-directory/file. This is NOT sapscript. The above class do