Action Script to restart movie with mouse

I added code using Script Assist in Flash CS4 to pause the
movie at the end frame until the user clicks on the mouse to
restart it. Seemed so easy but I have tried everything I can think
of and nothing works. I actually did this in an earlier version of
Action Script and now I am lost. The code I used is attached. Any
help is greatly appreciated!
Richard

Installed and working. Thanks for the code!

Similar Messages

  • Character movement with mouse click

    This will be for an MMO online game/ world. So it needs to be good.
    Hi guys. I'm really happy I got this to work as I'm a neebie to AS3 but getting to love its simplicity. My problem is not my AS3 but my maths.
    I click the mouse and the movieclip runs to the mouse's x position. However, it only goes in one direction ie: downwards and to the right.
    I need to it go in all directions depending on where I click. I suppose it has to do with comparing x and y positions of both mouse and mc - ie: if one is bigger than the other then you can tell where both are positioned and then put the code in. Am I right and does anybody hace a little code like this flying around for me?
    import flash.display.Stage;
    import flash.events.Event;
    stage.addEventListener(MouseEvent.CLICK, myClickReaction);
    function myClickReaction (e:MouseEvent):void{
        sunny.gotoAndPlay("runback")
        //sunny.x = root.stage.mouseX
        //sunny.y = root.stage.mouseY
        addEventListener(Event.ENTER_FRAME, onEnterFrame);
    function onEnterFrame(event:Event):void {
                 var xDistance:Number
                 var yDistance:Number
                //mc increments by 5 until it reaches mouse - mc (ie the distance)
                sunny.x += 5;
                sunny.y += 5;
                xDistance = root.stage.mouseX - sunny.x
                trace (xDistance)
                if (xDistance <= 0 ) {
                trace("works")
                sunny.gotoAndPlay("static")
                removeEventListener(Event.ENTER_FRAME, onEnterFrame);

    Thanks for contacting but the code more or less works already apart from the comments below.
    The position I get comparing mousex position and movieclip position. BUT it goes loopy when I move the mouse around. ie: I need the coordinates when I click and not a variable that changes while I move mouse around.
    I will check it out now.
    import flash.display.Stage;
    import flash.events.Event;
    stage.addEventListener(MouseEvent.CLICK, myClickReaction);
    function myClickReaction (e:MouseEvent):void{
    //sunny.x = root.stage.mouseX
    //sunny.y = root.stage.mouseY
    addEventListener(Event.ENTER_FRAME, onEnterFrame);
    function onEnterFrame(event:Event):void {
                 var xDistance:Number
        var yDistance:Number
       //mc increments by 5 until it reaches mouse - mc (ie the distance)
                // if you click to the right of sunny then mouse is > than sunny.x so x = 5
       if (root.stage.mouseX > sunny.x) {
        sunny.gotoAndPlay("walk right")
        sunny.x += 5;
        sunny.y += 0;
        xDistance = root.stage.mouseX - sunny.x
        //if (xDistance <= 0 ) {
        //sunny.gotoAndPlay("static")
        //removeEventListener(Event.ENTER_FRAME, onEnterFrame);

  • How to control the speed of nested movie with mouse

    I have a movie nested inside another movie with pictures that
    scroll horizontally across the screen. I would like the user to be
    able to control the speed and direction of the pictures by moving
    their mouse. Can anyone give me some insight on where to look to
    find out how to do this?
    If this can't be done then perhaps add controls on the screen
    to stop / play / speed up / slow down the horizontal scrolling
    pictures

    it can be done. search for a scrolling movieclip tutorial
    using google or at flashkit.com

  • Controlling movie with mouse location

    I am a designer trying to be a flash programmer and I have a
    navigation idea that I've been struggling with. I am simply trying
    to do this: put a movie on the stage and as the mouse moves closer
    or farther from the movie, it plays forwards and backwards. The
    movie I made is a circular logo with navigation buttons curling out
    from it like a jack knife. My idea is to have the buttons curl out
    as the user moves the mouse closer to the logo and curl back in as
    the mouse moves away.
    I understand the coding concept - calculate where the cursor
    is on the stage, figure out the distance of the cursor to the logo
    movie, and just go to certain frames in the logo movie based on
    that distance.
    I have the stage, the logo movie, and even the code to figure
    out the the mouse location. But beyond that, I need help. I just
    don't know enough about actionscript syntax and although
    conceptually this seems like a basic exercise, I really don't know
    where to start. If anyone is willing to help, the .fla file can be
    downloaded here:
    http://0099d33.netsolhost.com/westside-home2.fla
    Thanks so much for any help you can offer.
    null

    You would replace the one mDistance line in your original
    with the three I've given you. But if you weren't able to figure
    that bit out, you might not be able to figure out how to modify the
    whichFrame line either? Do you have a conceptual understanding of
    what your code is doing? Being able to read the code and understand
    what it is doing is really central to Actionscript. So here goes:
    mcLogo.onEnterframe: this is attaching some code that will
    repeat at the frame rate of the movie to the mcLogo instance. Even
    if there is a stop() on the timeline, this code will continue to
    repeat at the framerate set by your movie. By attaching it to
    mcLogo your scope will be mcLogo.
    In both version the next line (or three in my case) say find
    the distance between the current mouse position and this._x (for
    example). Since we are inside an onEnterFrame which is attache to
    mcLogo, so "this" refers to that time line. So this._x is saying
    the _x location of the mcLogo clip.
    If you remember basic geometry a right hand triangle's long
    side (the hypotenuse) is given by h^2 = a^2 + b^2. (The square of
    the hypotenuse is equal to the sum of the squares of the other two
    sides.) So we are figuring out how far between mcLogo and the mouse
    in the x and the y directions. This gives us the other two sides.
    So the distance between the mouse and the clip is the square root
    of the sum of the squares of those two sides.
    Finally since you need to adjust the distance to some scale
    of the number of frames you have added to your clip. So your have
    some code that makes the distance proportional to the number for
    frames in your clip.
    As for the second part of your question, "Don't use scenes!"
    So that makes that easy. Scenes are great tools for organizing your
    timelines when you are just doing some timeline-based animations.
    But when using Actionscript there are some bugs and limitation in
    scenes and you are only asking for trouble.
    So if you have this code say on frame ten with a stop().
    There is no looping that needs to happen. The onEnterFrame will
    continue doing the animation until someone clicks.
    Add maybe ten blank frames after 10 and then on frame 20 put
    your new thing you want – perhaps even give it a frame label
    called, "home" or "about" or whatever section it is about. Then you
    can use:
    this.gotoAndPlay("about");
    Also don't forget that you will want to remove the
    onEnterFrame event because otherwise it will keep running. So you
    should probably also include:
    delete mcLogo.onEnterframe;

  • Desktop moves with mouse!

    A friend reported to me from work that when she mouses, the whole desktop on her computer (10.4.11, but not sure what model, maybe a G4 tower) moves with the mouse movement! Is this a known issue? Any solution?

    Hi there,
    It sounds as if she might have accidently enabled the zoom feature. This can be toggled on and off using the cmdoption8 combination or in the 'Universal Access' pane of System Preferences. The zoom level can be controlled with the cmdoption'=' or cmdoption'-' keyboard combinations.
    Yang

  • Camera moves with mouse

    Hi guys,
    Just a quick post with HOPEFULLY a quick and helpful answer.
    See
    the background effect on this game which moves the background
    when the mouse is moved, I would love to know how to make something
    similar to that. Can you either, Direct me to a tutorial that will
    teach me how to do this OR do you know the script to do this?
    All help is appriciated!
    Thankyou!

    well, if you really want to duplicate the effect of your
    link, just use a scrolling movieclip whose scrolling is a function
    of the mouse position.
    the class below sets up the scrolling for a member of the
    class. usually a mask is used to display the scrolling movieclip
    and this class requires one. just use a mask movieclip the same
    dimensions as your stage:

  • I need an action/script for image resizing with a "special" attribute

    Having a headache, nothing work so far the way I want it...
    So here's the deal: I have a bunch of psd files and I need them saved as jpegs in a fixed size - 450x590px.
    The filename of the jpeg should be the same as each psd and the images should be resized proportionate.
    The psds have irregular sizes, some are tall, some are square, some are wide, etc.
    I tried using the place function on a template, but that requires my input - choose what to place, then type the filename.
    Any ideas?
    Thank you for your input!

    elmoldovano wrote:
    So here's the deal: I have a bunch of psd files and I need them saved as jpegs in a fixed size - 450x590px.
    The filename of the jpeg should be the same as each psd and the images should be resized proportionate.
    The psds have irregular sizes, some are tall, some are square, some are wide, etc.
    I tried using the place function on a template, but that requires my input - choose what to place, then type the filename.
    So have both Portrait and Landscape images with varying size. and want to create jpeg from them that are 450x590 pixels in size.  Can the have Portrait and Landscape orientations.  If they all must be Portraits 450px wide by 590px high  your landscape images composition will not fair well.  For cropping landscape image to portraits image normally crops away  to much image content.   Content aware scale may work somewhat better then cropping to portrait the introduced distortion may be acceptable.
    If Portrait 450x590px and Landscape 590x450px is an acceptable solution.  I would go with a cropping solution for there will be no distortion and centered crop composition are usually acceptable.   It can also be done with a two step action used by an image processor script.  If you download my crafting action package. It has a plug-in script that can be recorded in an action to set a 45:59 centered aspect ratio selection which you follow with an Image Crop step.  You run the Image Processor  script have the action make the crop and the Image processor to resize the crop to fit into a 590x590px area.
    Crafting Actions Package UPDATED Aug 14, 2012 Changed AspectRatioSelection Plug-in script added Path support.
    Contains
    Action Actions Palette Tips.txt
    Action Creation Guidelines.txt
    Action Dealing with Image Size.txt
    Action Enhanced via Scripted Photoshop Functions.txt
    CraftedActions.atn Sample Action set includes an example Watermarking action
    Sample Actions.txt Photoshop CraftedActions set saved as a text file.
    12 Scripts for actions
    Example
    Download

  • Frozen icons - files will not move with mouse.

    Hello, all.
    All of a sudden I noticed that the icons on notebook's desktop have stopped responding to my mouse commands. I've tried with the built-in trackpad as well as with an external mouse. I've also tried to create a test user but the same happens.
    I have also booted the system with Leopard's installation DVD and verified/repaired permissions to ensure that it wasn't the problem but the same continues to happen. I also verified read and write rights to these folders but nothing seems to be out of order (at least nothing that I can see).
    This started happening after the internal drive became full and my wife deleted several photos stored in iPhoto.
    Any ideas of what might be the cause and how to fix it ?
    Thank you in advance for your help.
    Joseph

    Just upgraded to 10.5.8 today and suddenly this problem appeared.
    The thread starter tried his best to explain the problem but everyone seemed to be suggesting things that were not responsive to this problem (yet plausible overlooks for a n00b on OS X)
    Let me first say that I have been using a Mac since 1988, and OS X since the day the Public Beta released. So, I know all the little tricks to try like zapping the PRAM, checking the align to grid settings and other stuff we used to try, just before disabling extensions and rebuilding the desktop :P
    Here's what I am seeing: Any icon displayed in icon view is selectable, but immovable. You can double click on the icon to launch it, right click on it...do everything except move it. Even tried some of the old favorites like holding down a modifier key and dragging. Nope, still locked down.
    I looked deep to find if there wasn't some kind of "Lock icons in place" setting in the 10.5.8 update that accidentally got enabled by default.
    Also tried starting up with no battery or other accessories plugged in (after zapping the PRAM a few times).
    Tried logging in to another account on the machine to see if it was my user account that was corrupted - same results in my son's account.
    I am running a MacBook Pro 2.33 with 10.5.8 and 2GB of RAM.
    This seems suspiciously tied to the update, but it may be a nasty coincidence. I have been holding off on installing my Snow Leopard upgrade because of the CS3 issues I have heard about. I hope this is not the "force point" on that. And rebuilding my drive from scratch? Ugh! I think I would just move to an "off the grid" commune instead of facing that one.
    Any help would be greatly appreciated.
    Thanks!
    Mike
    UPDATE: this problem is affecting all dragging, not just icons. I just tried to drag the URL for this thread from the address bar to the desktop for later reference. Nope. Allows me to double click to select it, but not drag it.
    Message was edited by: Fiodan
    Message was edited by: Fiodan

  • Action Script 3 help me with this tutorial?

    Can someone show me what code I am suppose to have made at the end of the tutorial. In my version the button I click doesn't work to move onto the game.
    Activity 3:
    Aim: Creating a new INIT function for the “Start Screen”.
    1. The next step to this game is to create a “Start” screen. Now this is going to be the
    first thing that loads when the game start, so the suggestion is we make some changes
    to the structure of the current game. The first thing is renaming:
    private function init(e:Event = null):void
    To:
    private function game(e:Event = null):void
    This helps make the title for this function more obvious and appropriate.
    2. Now that we have made this change we can recreate a brand new init function for the
    start screen. We create this above the game function.
    The new public function init(e:Event = null):void will contain:
    • Declaring the start image as a new Go();
    • add it as a child• Position it suitably in the centre of the screen.
    Test and Annotate
    3. Now that the start button image is displayed on the screen appropriately we need to
    make it clickable. So, within the new init function add an “EventListener”, which is
    a “MouseEvent” CLICK, which takes you to a new Method called “startgame()”.
    4. So now that the listener is in place we need to make the new public function called
    “startgame()”, for which the previous listener is pointing to. This will look like:
    public function startgame(e:Event):void
    //SOME CODE
    This is to be placed under your init function. The “e:Event” part states that this will
    have some kind of action event happening to it.
    5. Within this Method we need to set up a statement that will send the player to the game
    itself when the start image is clicked. This will be an “If” statement, and will look like
    this:
    Start => The e.target==start =(True)=> removechild(start) => game() =>stop

    // that looks like a pretty poor tutorial.  but
    public function init(e:Event=null):void{
    go=new Go();  // you need to declare go
    addChild(go);
    go.addEventListener(MouseEvent.CLICK,startgame);
    public function startgame(e:Event):void{
    removeChild(start_mc);  // where start_mc is the movieclip of your start screen
    addChild(game_mc);  // where game_mc is the movieclip of your game

  • Action Script Newbie has problem with Slide Show Pro

    Hi,
    here is a demo page -
    http://www.libertypromotions.com/asptest/newsite/cars/product_page.htm.
    The flash gallery in the top left is my problem child. I am
    using Slide Show pro to display my images but I want to add some
    external buttons that will switch albums when you click them (all
    images are in there own album, giving me the Grid effect when you
    click see all) I have asked for help on how to do this on their
    forums, but they are useless (so far) so I came here. Below is the
    code SSP provides for external Next/Previous buttons that switch
    images inside albums.
    I am hoping someone here knows SSP well enough to help me
    with this.
    Thanks in advance.

    cowenstx,
    Javascript is VERY different from Java. Your code example is Javascript, a scripting language invented by Netscape. Do a web search for "javascript images" for lots of good pointers.

  • Move a mouse with Apple script

    Hello,
    I need some apple script code to move a mouse to a certain location and then click. If possible could it record the location of the mouse, move it to the pre-assigned coordinates, click, and them move it back to where it was.
    I am doing this so I can use multivid and Qlab to play different videos on different iOS devices. Multivid doesn't seem to let me have a cue list with different videos playing simultaneously.
    I will have my iMac set up with 2 displays, one with Qlab and the other with multivid in full screen.
    Thanks for the help

    Here's another code using rubycocoa you might try.
    _rb_click({|:position|:{30, 10}, |:click|:1, |:restore|:true, |:prep|:false})
    on _rb_click(desc)
            record desc : event descriptor record;
                full spec = {|:position|:pos, |:click|:k, |:button|:b, |:flags|:m, |:restore|:r, |:prep|:p}
                defaults   = {|:position|:{}, |:click|:0, |:button|:1, |:flags|:"", |:restore|:false, |:prep|:true}
                list pos : {x, y} or {}
                    number x, y = x, y global coordinate of position
                    {} denotes current location
                integer k : click count (0, 1, 2 or 3}; 0 denotes only to move mouse and exit
                integer b : button index (1 = left button, 2 = right button)
                string m : modifier flags; e.g. 'ck' = control + command
                    a = capslock
                    s = shift
                    c = control
                    o = option
                    k = command
                boolean r : true to restore original mouse location, false otherwise
                boolean p : true to post preparatory left 1-click event to change UI context, false otherwise
            return list : {x, y} = mouse location at exit
        considering numeric strings
            if (system info)'s system version < "10.9" then
                set ruby to "/usr/bin/ruby"
            else
                set ruby to "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby"
            end if
        end considering
        set defaults to {|:position|:{}, |:click|:0, |:button|:1, |:flags|:"", |:restore|:false, |:prep|:true}
        set {|:position|:pos, |:click|:k, |:button|:b, |:flags|:m, |:restore|:r, |:prep|:p} to desc & defaults
        if pos = {} then
            set {x, y} to {"%", "%"}
        else
            set {x, y} to pos
        end if
        if k is not in {0, 1, 2, 3} then error "invalid click count: " & k number 8000
        if b is not in {1, 2} then error "invalid button index: " & b number 8000
        if m = "" then set m to "%"
        do shell script ruby & " <<'EOF' - " & x & " " & y & " " & k & " " & b & " " & m & " " & r & " " & p & "
    require 'osx/cocoa'
    include OSX
    if ARGV[0..1] == ['%', '%']
        pt = CGEventGetLocation(CGEventCreate(nil))        # current mouse location
    else
        pt = CGPoint.new
        pt.x, pt.y = ARGV[0..1].map {|a| a.to_f}
    end
    clk, btn = ARGV[2..3].map {|a| a.to_i}
    flg = ARGV[4]
    res, prep = ARGV[5..6].map {|a| a == 'true'}
    etype, mbtn = case btn
        when 1 then [KCGEventLeftMouseDown, KCGMouseButtonLeft]        # [1, 0]
        when 2 then [KCGEventRightMouseDown, KCGMouseButtonRight]    # [3, 1]
        when 3 then [KCGEventOtherMouseDown, KCGMouseButtonCenter]    # [25, 2]
        else raise ArgumentError, %[invalid mouse button: #{btn}]
    end
    mtable = {
        'a'    => KCGEventFlagMaskAlphaShift,
        's'    => KCGEventFlagMaskShift,
        'c'    => KCGEventFlagMaskControl,
        'o'    => KCGEventFlagMaskAlternate,
        'k'    => KCGEventFlagMaskCommand,
    mf = flg.split(//).inject(0) { |mf, x| (m = mtable[x]) ? mf | m : mf }
    src = CGEventSourceCreate(KCGEventSourceStateHIDSystemState)
    tap = KCGHIDEventTap
    pt0 = CGEventGetLocation(CGEventCreate(src))                    # current mouse location
    # move mouse to target location
    ev0 = CGEventCreateMouseEvent(src, KCGEventMouseMoved, pt, 0)    # move mouse
    CGEventPost(tap, ev0)
    if clk == 0
        puts pt.x, pt.y
        exit
    end
    # post preparatory left mouse click to change UI context (optional)
    if prep
        ev1 = CGEventCreateMouseEvent(src, KCGEventLeftMouseDown, pt, KCGMouseButtonLeft)    # mouse left button down
        CGEventPost(tap, ev1)
        CGEventSetType(ev1, KCGEventLeftMouseUp)                    # mouse left button up
        CGEventPost(tap, ev1)
    end
    # post target mouse click(s) with given flags
    ev = CGEventCreateMouseEvent(src, etype, pt, mbtn)                # mouse button down
    CGEventSetFlags(ev, mf)                                            # set flags
    CGEventSetIntegerValueField(ev, KCGMouseEventClickState, clk)    # set click count
    CGEventPost(tap, ev)
    CGEventSetType(ev, etype + 1)                                    # mouse button up
    CGEventPost(tap, ev)
    # restore mouse location (optional)
    if res
        CGEventSetLocation(ev0, pt0)                                # restore mouse location
        CGEventPost(tap, ev0)
        puts pt0.x, pt0.y
        exit
    end
    puts pt.x, pt.y
    EOF"
        set rr to paragraphs of result
        repeat with r in rr
            set r's contents to r as number
        end repeat
        return rr
    end _rb_click

  • Filereference Upload - A script in this movie is causing Adobe Flash...

    This appears to be a sore topic these days. I have searched and found a large number of postings with this flash player message (A script in this move is causing Adobe Flash Player -n- to run slowly. If it continues...) But I haven't found a posting where it is resolved. I am trying to provide my client with an upload script. What I have so far works on small files but results in the aforementioned error message on large files. I saw a message a few days ago that talked about writing an onEnterFrame routine in a dummy movie clip that increments a counter, but there were no details about what that code might look like.  I have tried several iterations of that logic to no avail.  I know I am not the only one with this problem, and I do need to find a solution. I don't think that the server php settings are the problem.  Does anyone have any ideas?
    Thanks in advance,
    GW
    Action script from Layer 1: Frame 1 -
    _global.states = Array("AL", "AK", "AS", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FM", "FL", "GA", "GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MH", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", "WA", "WV", "WI", "WY");
    _global.states.sort();
    _global.keepMemory = false;
    this.mc_uploadCtr.mc_stateError._visible = false;
    this.mc_uploadCtr._visible = false;
    this.mc_uploadCtr.enabled = false;
    // Get upload data
    var xmlData=new XML();
    xmlData.ignoreWhite=true;
    xmlData.onLoad = function(ok:Boolean) {
       if (ok) {
           processXmlData(this);       
       } else {
           dt_main.text = "XML did not load";
    function processXmlData(xml:XML) {
        _global.notifyToEmail    = xml.firstChild.childNodes[0].childNodes[0].nodeValue;
        _global.notifyFromEmail = xml.firstChild.childNodes[1].childNodes[0].nodeValue;
        _global.notifyFromName     = xml.firstChild.childNodes[2].childNodes[0].nodeValue;
    System.useCodepage = true;
    xmlData.load('uploadData.xml');
    _global.keepInMemory = function(keep:Boolean) {
        if ((keep == true) and (_global.keepMemory == false)) {
            _global.keepMemory = true;
            this.createEmptyMovieClip("dummy_mc", 999);
            this.dummy_mc.onEnterFrame = function () {
                while(_global.keepMemory == true) {
                    var count:Number = count + 1;
        } else {
            if (_global.keepMemory = true) {
                _global.keepMemory = false;
                this.dummy_mc.unloadMovie();
    stop();
    Action Script from upload movie clip:
    import flash.net.FileReference;
    var progressBar:MovieClip;
    var reference:FileReference = new FileReference();
    var referenceListener:Object = {};
    var scriptLocation:String = 'uploader.php';
    var progressBarHeight:Number = 10;
    var progressBarY:Number = 50;
    var progressBarColor:Number = 0x66ccff;
    reference.addListener(referenceListener);
    referenceListener.onSelect = activateUploadButton;
    referenceListener.onProgress = updateProgress;
    referenceListener.onComplete = checkIn;
    referenceListener.onHTTPError = handleError;
    referenceListener.onIOError = handleError;
    referenceListener.onSecurityError = handleError;
    btn_uploadFile._visible = false;
    btn_selectFile.onRelease = choose;
    btn_uploadFile.onRelease = uploadCurrent;
    function activateUploadButton():Void {
        display_txt.text = reference.name;
        btn_uploadFile._visible = true;
        btn_uploadFile.enabled = true;
    function choose():Void {
        reference.browse([{description:'Images (*.ai, *.drw, *.jpg, *.jpeg, *.gif, *.pdf, *.png, *.psd, *.psp, *.tif,)', extension:'*.ai; *.drw; *.jpg; *.jpeg; *.gif; *.pdf; *.png; *.psd; *.psp; *.tif'}]);
    function handleError(errorName:String, detail:Object):Void {
        restart();
        if (arguments.length === 2) {
            if (typeof detail === 'number') {
                display_txt.text = 'HTTP Error #'+detail;
            } else {
                display_txt.text = 'Security Error: '+detail;
        } else {
            display_txt.text = 'IO Error';
    function makeProgressBar(x:Number, y:Number):MovieClip {
        var bar:MovieClip = createEmptyMovieClip('progressBar_mc', 0);
        bar._visible = false;
        bar.beginFill(progressBarColor);
        bar.lineTo(display_txt._width, 0);
        bar.lineTo(display_txt._width, progressBarHeight);
        bar.lineTo(0, progressBarHeight);
        bar.lineTo(0, 0);
        bar.endFill();
        bar._width = 0;
        bar._visible = true;
        bar._x = x;
        bar._y = y;
        return bar;
    function restart():Void {
        removeMovieClip(progressBar);
        display_txt.text = '';
        btn_uploadFile._visible = false;
        btn_selectFile._visible = true;
    function updateProgress(fileReference:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
        display_txt.text = fileReference.name+' - '+Math.ceil((bytesLoaded/bytesTotal)*100)+'%';
        progressBar._width = Math.ceil(display_txt._width*(bytesLoaded/bytesTotal));
    function uploadCurrent():Void {
        btn_selectFile._visible = false;
        btn_uploadFile.enabled = false;
        progressBar = makeProgressBar(0, progressBarY);
        _global.keepInMemory(true);
        reference.upload(scriptLocation);
    function checkIn():Void {
        _global.keepInMemory(false);
        moveFile();
        notify()
        restart();
    function moveFile():Void {
          _global.uploadedFile = (_global.uploadFolder + '/' + reference.name);
    //    var lv_result:LoadVars = new LoadVars();
    //    var lv_move = new LoadVars();
    //    lv_move.fileName = reference.name;
    //    lv_move.rootFolder = (_global.rootFolder);
    //    lv_move.sourceFolder = (_global.uploadFolder);
    //    lv_move.targetFolder = (_global.uploadFolder);
    //    lv_move.sendAndLoad("mover.php", lv_result, "POST");
    function notify():Void {
        var st_companyName:String = ('<tr><td>Company name:</td><td>'+_global.companyName+'</td></tr>')
        var st_contactName:String = ('<tr><td>Contact name:</td><td>'+_global.contactName+'</td></tr>')
        var st_phoneNumber:String = ('<tr><td>Phone number:</td><td>'+_global.phoneNumber+'</td></tr>')
        var st_address:String = "";
        if (_global.address2 <> "") {
            st_address = ('<tr><td>Address:</td><td>'+_global.address1+'</td></tr><tr><td> </td><td>'+_global.address2+'</td></tr><tr><td> </td><td>'+_global.addressCity+', '+_global.addressState + ' ' + _global.addressZip + '</td></tr>');
        } else {
            st_address = ('<tr><td>Address:</td><td>'+_global.address1+'</td></tr><tr><td> </td><td>'+_global.addressCity+', '+_global.addressState+' '+ _global.addressZip + '</td></tr>');
        var st_email:String = ('<tr><td>E-Mail:</td><td>'+_global.email+'</td></tr>')
        var st_quantity:String = ('<tr><td>Quantity:</td><td>'+_global.quantity+'</td></tr>')
        var st_sides:String = ('<tr><td>Sides:</td><td>'+_global.sides+'</td></tr>')
        var st_paperWeight:String = ('<tr><td>Paper weight:</td><td>'+_global.sides+'</td></tr>')
        var st_jobDescription:String = ('<tr><td>Desc/Title of job:</td><td>'+_global.jobDescription+'</td></tr>')
        var st_uploadedFile:String = ('<tr><td>Uploaded file:</td><td>'+_global.uploadedFile+'</td></tr>')
        var result_lv:LoadVars = new LoadVars();
        result_lv.onLoad = function(success:Boolean) {
        if (success) {
        } else {
        var lv_notify = new LoadVars();
        lv_notify.sender_fromEmail = _global.notifyFromEmail;
        lv_notify.sender_toEmail = _global.notifyToEmail;
        lv_notify.sender_fromName = _global.notifyFromName;
        lv_notify.sender_subject = ('File received from ' + _global.companyName);
        lv_notify.sender_message = ('<table width="550" border="1" align="left">' + st_companyName + st_contactName + st_phoneNumber + st_address + st_email + st_quantity + st_sides + st_paperWeight + st_jobDescription + st_uploadedFile + '</table>');
        lv_notify.sendAndLoad("sendmail.php", result_lv, "POST");
        return;
    uploader.php -<?php
        if ($_FILES['Filedata']['name']) {
            upload_max_filesize = 100M;
            post_max_size = 100M;
            move_uploaded_file($_FILES['Filedata']['tmp_name'], 'uploads/' . basename($_FILES['Filedata']['name']));
    ?>

    Thank you, your answer was helpful. The problem was occuring before I entered the the code you referred to. But your response made me realize that the problem did, indeed, have to do with code that was running during the upload. I isolated the problem to the progress bar logic, which I suspect is not a coding error, but just too many cycles for the player to put up with during a long upload.  I am now searching for another method of displaying upload status without a tight piece of code that loops a lot.
    Thank you again kglad!

  • Moving a Layer based on percentages via action scripting.

    Hi,
    I am trying to create an action script that will move a layer 90% to the left or right. Can this be done thru actions or is it something that can only be done via JS Scripting. The reason I need percentages is not all images are the same dimensions.
    TIA

    You should be able to do it with either.
    With an action set you ruler to percent, select all on the layer you want to move and with the move tool move the image. The amount of the move will be recorded in percent.
    With a script use activeDocument.activeLayer.translate( new UnitValue(.9,'%'),undefined) to move to the right or activeDocument.activeLayer.translate( new UnitValue(-.9,'%'),undefined)to move to the left

  • Setting timeout settings for Action Scripts

    We are using OIM 11gR1 along with the AD and Domino connectors. We are also using Action Scripts to perform some post create actions on the AD and Domino resources that get created by OIM. The action scripts are being invoked with the correct set of parameters and they do their job. However for both connectors, the connector server (Java connector server for Domino, .NET connector server for AD) times out when waiting for the script to complete. Our scripts are expected to take a long time (30+ seconds).
    Based on our testing, the AD connector times out in 30 seconds, and the Domino connector times out in 20 seconds. You would get the below exception in your Java Connector Server log file:
    Dec 4, 2013 2:36:41 PM org.identityconnectors.framework.api.operations.ScriptOnConnectorApiOp runScriptOnConnector
    FINE: Exception:
    java.lang.RuntimeException: Timeout waiting for action, process was terminated
        at org.identityconnectors.domino.WinJni._executeWinCommand(Native Method)
        at org.identityconnectors.domino.WinJni.executeWinCommand(WinJni.java:31)
        at org.identityconnectors.domino.ScriptOnConnector.executeCmdScript(ScriptOnConnector.java:143)
        at org.identityconnectors.domino.ScriptOnConnector.runScriptOnConnector(ScriptOnConnector.java:88)
        at org.identityconnectors.domino.DominoConnector.runScriptOnConnector(DominoConnector.java:316)
    Is there any way to configure OIM so that it waits longer for the action script to complete. The real problem over here is that if 2 users are being provisioned to AD and/or Domino simultaneously (we use access policies to trigger provisioning rules), then the connector (Java or .NET) does NOT invoke the action script for the second user if the action script for the first user times out. It does however create AD/Domino resources for all applicable users. This in itself is a defect - but I need a workaround.
    Looking at some old Sun Identity Manager documentation (which became Oracle Waveset), it seems that the entire OIM concept of action scripts has its origins in Sun Identity Manager/Oracle Waveset. And these products did support the notion of timeouts. Have a look at :
    http://docs.oracle.com/cd/E19225-01/821-0092/bzbuc/index.html
    Does anyone familiar with Oracle OIM code know if custom timeouts are supported by AD and Domino connectors?
    Thanks
    Aspi Engineer

    Change the time for the below under 'Web Intelligence Processing Server'
    Idle Document Timeout (seconds):
    Idle Connection Timeout (minutes):
    If you still have problem then try changing the web.xml under the following war files,
    AdminTools
    PartnerPlatformService
    PerformanceManagement
    PlatformServices

  • Invoke an application using mxml or action script

    Hi all
    I am using flex 2.0 beta 3. And i would like to know if any
    method is there to invoke a software using mxml or action script.
    I tried with URLLoader and URLRequest to load and open a
    file, with a hope that the file will open in the default program
    that i configured for that file to open. But i got an error saying
    Stream Error.
    Can anybody guide me to resolve this issue ..
    Rakesh

    Here is one possible solution:
    You can use the ExternalInterface (
    http://livedocs.macromedia.com/flex/2/langref/flash/external/ExternalInterface.html)
    class to communicate with JavaScript. JavaScript can then popup the
    media player very easily like this:
    http://www.webreference.com/programming/javascript/jf/column5/index.html
    The documentation on the ExternalInterface class has a nice
    example (in the bottom of the page) on how to communicate with
    JavaScript in a browser. Hope this helps,
    -george

Maybe you are looking for

  • Need to send sms to the customer through Oracle Apps Custom form

    Hi All, This is sandeep, i have design a Oracle Apps Custom form, i am entering the Customer related date like customer name, number, customer Amount, cheque number, customer phone number, user want, when the user will save that form, so that above i

  • Have problems to create lagacy data (AS91) with asset that purchase in 2010

    Dear All Experts, I have some problems when I try to create lagacy data via AS91 but it's not allow me to post acquisition value and accumulate depreciation into asset that have capitalize date on this year (30.09.2010)   Could anyone please tell me

  • "main()" won't terminate after Naming.list

    The code below will not terminate when executed - it displays the correct values and enters/exits. But just won't return to the command line? Anybody know why this happens? For now I'm using System.exit(0). void main() { print("Enter");      for (Str

  • Error compiling, out of memory

    I just finished my first ever PE movie, and I exported it successfully. I watched the exported movie and discovered one tiny thing I wanted to fix. So I made the change in PE, then tried to export again. Now, it only gets about 1/3 of the way through

  • I didnt receive a text message from Ovi Store mod...

    for  selecting the link in the message.