The use of JavaScript in the Flash script and createJS, trouble, referencing the element on the stage

Hello

Relatively new to JavaScript, so don't know if it's too complicated to remove in the Flash timeline. I have a question on the stage with the name of the instance "myBox". I'm trying to take it to the coordinate x of a touch on the iPad. The JS looks like this

/ * js

document.addEventListener ('touchmove', Function {}

Event.preventDefault ();

touch var = e.touches [0];

this.myBox.x = touch.pageX;

(}, false);

*/

Is it possible to "myBox" from inside the function of reference? this.myBox does not work when I publish Toolbox for createJS. I am able to get the coordinate x of the key event when I try to alert (touch.pageX);

Thanks for the help!

you lose the scope of this function.  Try:

/ * js

function moveBox (obj) {}

obj.x = 600;

}

moveBox (this.myBox);

*/

or, more generally, you can pass a reference to "this":

/ * js

var tl = this;

function moveBox (obj) {}

obj.myBox.x = 600;

}

moveBox (tl);

*/

p.s. Please check the useful/correct.

Tags: Adobe Animate

Similar Questions

  • How to get the user clicks SeriesName APEX 4.2 flash chart and defined on a hidden element?

    Hello

    I'm developing a graphic clickable flash of APEX, which should be linked to a specific set of data on another page using the SeriesName (clicked several sets of cards).

    (Returned by a function) sql for APEX chart is

    Select distinct null link, d. DNAME label
    , sum(e. SAL ) over (partition by e. ( DEPTNO salary ( )
    , sum(e. Comm ) over (partition by e. DEPTNO ) comm
    de d Dep. , emp e
    e. DEPTNO = d . DEPTNO

    Currently I am able to disply SeriesName (e.g. salary or Comm) on the 2D chart. This is done by including {% SeriesName} Custome XML.

    But I am unable to detect which series name, the user clicks on - pay is comm.  for example, I am not able to enter the name of the series clicked and set it to a hidden item (called P38_SERIES_NAME).  I have to use JavaScript to achieve this? If so, how?

    The reason why I want to use the unique sql is due to that I will have to call a function to return the dynamic and running sql code, I don't know how many series I. i.e. could be comm, average age, salary, bonus etc...

    What is the easiest way to achieve this?   I use APEX 4.2 and Oracle 11 g.

    Thanks for your advice.

    Concerning

    Susanna Su

    Susanna,

    What you experience is the difference between session state and the value of the element on the page. The URL you have is generated on the rendering of the page and use the value of current session state of the question right now. Then when the page is on the client side and that you set the value of the item through javascript this value is still next to the customer and not in session state. Put the value in session state would not matter, however, because the link has already been made. Your best option is to send the page, ensuring the correct value is set to session state and use a branch in present after the process to redirect the user to the correct page.

    I have also described this here: https://forums.oracle.com/message/11110579#11110579

  • I use a compaq 2002 esystem pc using windows xp home edition Pack 3 and having trouble understanding how to make my pc wireless active

    Sky was issuied me with an installation CD, which says that it cannot find a wireless function on my pc but there is a connection network wizard in my pc but do not know how to set up the connection, I am currently connected to the sky with a wired ethernet connection but would go wireless

    Hello

    Please see the links below.

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/wlan_client_configure.mspx?mfr=true

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/wlan_client_connect.mspx?mfr=true

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/wireless_networking_overview.mspx?mfr=true

    http://www.sky.com/HelpCentre/broadband/set-up/set-up-wireless/

    http://support.Microsoft.com/kb/870702

  • I tried several times to install 'Flash Player' and it NEVER works. I can't view anything until that which works. It says I need to disable 'JavaScript' but I'm not in any of the places. Please tell me what to do.

    Flash Player will not work. It will not download

    Hi Janny1,

    JavaScript should not have to turn off. Try to completely uninstall Flash Player and then reinstalling the most recent version. For instructions on how to "completely" uninstall a Flash Player, read this Adobe Help article. If you have not installed Flash Player, or you have just uninstalled the Flash Player, download and install the latest Adobe Flash Player, available in the Adobe Flash Player Download Center.

    1 clear your browser's cache and cookies on your computer.

    For Windows Vista users: If the uninstallation and reinstallation of flash does not work this maybe due to a Microsoft Windows Vista permissions issue. Please use the Windows button below on the left then the search function:

    o go to: C:\Windows\System32\Macromed\Flash\

    o right click on the following file: FlashUtil9b.exe or FlashUtil9e.exe

    o select "Run as Administrator" and install the update.

    o your computer.

    http://Windows.Microsoft.com/en-us/Windows-Vista/what-should-you-do-about-Internet-Explorer-script-errors

    Troubleshoot installation of Flash Player for Windows
    http://kb2.Adobe.com/CPS/191/tn_19166.html

    How do I uninstall the plug-in Adobe Flash Player and ActiveX control
    http://kb2.Adobe.com/CPS/141/tn_14157.html

    You can also post your questions in the adobe forums.

    http://forums.Adobe.com/community/webplayers/flash_player

    Previous post: the result.

    Bindu S - Microsoft Support

    [If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message.] [Marking a post as answer, or relatively useful, you help others find the answer more quickly.]

  • Tip: The use of JavaScript with Breeze presentations

    Hi all

    One of the recurring comments our alpha testers was that there was no "Close" button on the last slide of our Breeze presentations. Of course, Breeze is no obvious ways to close the browser window, other than by clicking on the 'x' in the upper right. But, as the Breeze Viewer is contained in an HTML shell, the solution is really very simple: use the 'fscommand' overall in Actionscript to activate a script embedded in the HTML page.

    Operating instructions
    (1) make a simple Flash animation, with a button. In this case, ours consisted of a small button that says "quit". In the first frame of the movie, add the following actionscript event handler:

    btnName.onRelease = function () {}
    fscommand ("quit");
    }


    (2) insert file *.swf to this button in the proper PowerPoint slide and the Breeze presentation.

    (3) find the "index.htm" file out of the breeze and open it in Notepad.

    (4) find the "Sub SlideContent_FSCommand" function in vbscript section and add the following code to the function "to select":

    case "quit" window.close

    (5) in case you are using something that does not include vbscript (and I hope you ) add the following function at the top of the javascript section:


    function SlideContent_DoFSCommand (command, args)
    {
    Window.Close ();
    }


    Save the index.htm file, and then reopen it in your browser as always. When the user clicks on the button in the presentation of the breeze, it sends the command "quite" in the browser, which will handle either vbScript or JavaScript.

    Most of the time, we leave on the vbScript completely so that all fscommands are dealt with by a large declaration "case" in JavaScript. The only real issue I ran into that it is than some JS methods for the Window object (and some methods of Document, such as. write()) tend to fail.



    See you soon!

    ~ Marc B

    Hi all

    A better way to run commands small JavaScript (for a Flash module) is to use the getURL command:

    btnButtonName.onRelease = function () {}
    getURL ("javascript: window.close ();");
    }

    In this way, you don't need to fiddle around with any page, the Viewer is embedded in the HTML code.

  • Create the Excel using Indesign javascript file

    Hi all

    We can create csv file using indesign javascript. Is there a way to create excel file using indesign javascript?

    Thanks in advance

    Hi all

    It is a way to generate an Excel from an InDesign table by using a combination of jsx, vbs and applescript.

    Quite a long discussion on that Open with below is a better application of the suggestions here.

    // Exports SIMPLE tables to proper excel file single and double quotes in the table would have to be escaped on the Mac version
    // Does not take Unicode file names
    // with a bit of brain racking can be developed to deal with merged cells and nested tables
    // Pieced together by Trevor (wwww.creative-scripts.com coming soonish) based on the referenced sources
    // Sold AS IS https://forums.adobe.com/thread/1718021
    
    var doc = app.properties.activeDocument && app.activeDocument,
           myTable = myTable || getTable (doc);
    if (!myTable) {alert ("Take a break, needs a document with a table in it!"); exit();};
    var filePath = new File (Folder.temp + "/" + +new Date + ".xlsx"),
        osFilePath = filePath.fsName;
    if ($.os[0] === "M")  osFilePath =  osFilePath.replace(/(.)(\/)/g,"$1:").replace(/\//, "");
    
    exportTable (myTable, osFilePath);
    if (confirm ("Open new excel file")) filePath.execute(false);
     exit()
    function exportTable (myTable, filePath)
        {
            var  numberOfRows = myTable.rows.length,
                   rowNumber, columnNumber,
                   isMac = $.os[0] === "M",
                   rowContents = [],
                   setRange, openMark, closeMark;
    
            if (isMac)
                {
                    setRange = 'set value of range "A';
                    openMark = '" to {';
                    closeMark = '}';
                }
            else
                {
                    setRange = 'app.Range("A';
                    openMark = '") = Array(';
                    closeMark = ')';
                }
    
    for (var z = 0, rowNumber = 0; rowNumber < numberOfRows; rowNumber++) {
        var  numberOfColumns = myTable.rows[rowNumber].columns.length,
                toRange = GetExcelColumnName (numberOfColumns - 1),
                columnContents = [];
         for (columnNumber = 0; columnNumber < numberOfColumns; columnNumber++) {
             var cellContents = myTable.rows[rowNumber].cells.everyItem().contents;
             columnContents  = '"' + cellContents.join('", "') + '"';
         }
        rowContents[rowNumber] = setRange + ++z  + ":"  + toRange+ z + openMark  + columnContents + closeMark;
    }
    
    var tableData = rowContents.join("\n") + "\n";
    
                   if (isMac)
                        {
                            // Thanks Hans https://forums.adobe.com/message/5607799#5607799
                           var myAppleScript =
                            '''set excelRunning to isRunning("Microsoft Excel")
                               tell application "Microsoft Excel"
                               set theWorkbook to make new workbook
                               tell sheet (1) of theWorkbook'''
                               + tableData + '''
                               end tell
                               save workbook as theWorkbook filename "''' + filePath + '''"
                               close active workbook
                               if not excelRunning then tell application "Microsoft Excel" to quit
                               end tell
                               on isRunning(appName)
                                    tell application "System Events" to (name of processes) contains appName
                               end isRunning
                            ''';
                          app.doScript (myAppleScript, ScriptLanguage.APPLESCRIPT_LANGUAGE);
                        }
    
                    else
                        {
                            // Thanks Calos https://forums.adobe.com/message/5607799#5607799
                            // changed by me :-)
                             var vbscript =
                             '''Dim app
                                Set app = CreateObject("Excel.Application")
                                'take away the ' from the line below if you want to see excel do it's stuff
                                'app.visible = true
                                Dim newDoc, sheet
                                Set newDoc = app.Workbooks.Add()
                                Set sheet = newDoc.Worksheets(1)
                                '''
                                + tableData
                                + 'newDoc.SaveAs "' + filePath + '''"
                                app.Quit
                                Set newDoc = nothing
                                Set app = nothing
                              ''';
                            app.doScript (vbscript, ScriptLanguage.VISUAL_BASIC);
                        }
    
                }
    
    function GetExcelColumnName (columnNumber) {// 0 is A 25 is Z 26 is AA etc.
        // parsed from http://stackoverflow.com/questions/181596/how-to-convert-a-column-number-eg-127-into-an-excel-column-eg-aa
         var dividend = columnNumber + 1,
                columnName = "",
                modulo;
    
        while (dividend > 0)  {
            modulo = (dividend - 1) % 26;
            columnName = String.fromCharCode (65 + modulo) + columnName;
            dividend = Math.floor((dividend - modulo) / 26);
        }
        return columnName;
    }
    
    function getTable (doc) { // thanks Marc http://forums.adobe.com/message/6087322#6087322
        if (!doc) return false;
        app.findTextPreferences = null;
        app.findTextPreferences.findWhat = "\x16";
        var tables = doc.findText();
        if (tables.length) return tables[0].parentStory.tables[0];
        return false;
    };
    
  • questions about the uses of flash cs6 and the code that it exports VS. switch to other tools

    I looked at the overviews on the new version of flash and I did experiment a bit with muse and edge of adobe. I have also heard the announcement Friday 4.1 android devices will run is no longer the flash player. my questions are:

    1 does flash cs6 fuction basically the same design-wise, but when it comes to export the file, the code a combination of html and javascript rather than in a solid swf file as it was currently publishing my work as?

    2 East edge meant to supplement flash? or he will take some of the uses of the flash so edge can publish for flash and mobile devices will remain in the area of desktop applications?

    3. If I created full-flash sites in older versions of flash, can I import in cs6 and make them exported as functional across all devices?

    I guess that, overall, just trying to get an overview here so that I can decide how to move forward and what to focus on.

    Thank you!

    1. Yes. The Toolbox for CreateJS is an additional downloadable extension for Flash CS6. He's going to post html and js files that will provide the animation rather than the swf file that you would normally publish. The success or failure of the version of javascript from your animation is the result of the work within the Toolbox. You are a bit constrained in the use of the timeline in Flash for your animations. If you are only working in Actionscript, then the output will be very disappointing.

    2 edge outputs javascript, css and html for you give an animation. The user interface allows you to design within the limits of what can make the border. You can preview and adjust and adjust your animation work you. Edge is a tool of html5. It can create some animation html5. It is not a replacement for Flash. It's something that you can use to integrate the animation in html instead of Flash.

    The problems and the benefits of each are unique. It is a good substitute to learn javascript, css and HTML 5. If you don't understand the code that is created from each of these tools, you can easily end up with huge, inflated, files which improved. I'm very biased towards really knowing what is happening. If I need to change something, I want to be able to enter the code and make a change, do not add an extra piece of code to work around what was there. I don't use any of the timeline, and so nothing of what I publish using CreateJS. Well, he's going to publish, but nothing happens because there is nothing on the timeline to translate.

    You can download a trial version of Flash CS6 and try to box at tools for yourself. Edge is still in free preview, you can get a copy to http://labs.adobe.com and try to see how it works.

    Also, if you do not use the Greensock Animation with Flash platform, take a look at this. It has recently been extended to ensure similar Javascript for most libraries. http://www.greensock.com/

  • Animation freezes (I think because the script is Flash 6 and my doc is CS3)?

    I have an animation for particles script that has been created in Flash 6. I'm trying to recreate it in my flash document that is configured as Flash 8. I couldn't get the animation to play, and then I realized that if I return to this original Flash 6 and change it to Flash 8, it will not play in this document either.

    I'm really new with Flash and scripting in general. Is there a preferred solution, we need to change the Flash 6 particles effect document so that I can re-create it in my Flash 8 document and have it animate?

    I have attached the file, but here's the script...

    This is the script in the timeline:

    c = 0;
    totalParticles = 100;
    While (c < totalParticles) {}
    c ++ ;
    duplicateMovieClip ("particle0", "particle" + c, c);
    }

    And this is the script in the subject of the film:

    onClipEvent (enterFrame) {}
    r ++ ;
    Yvel +=(yvel2-yvel)/10;
    xvel +=(xvel2-xvel)/10;
    If (r == as) {}
    As = minVal + Random (RND);
    r = 0;
    yvel2 = ((rvel*2) + 1 random)-rvel;
    xvel2 = ((rvel*2) + 1 random)-rvel;
    }
    _x += xvel;
    FLF += yvel;
    }
    onClipEvent (load) {}
    _xscale = _yscale = 10 + random (50);
    _x = random (Stage.width);
    FLF = random (Stage.width);
    minVal = 25;
    RND = 25;
    As = minVal + Random (RND);
    rvel = 1;
    yvel2 = ((rvel*2) + 1 random)-rvel;
    xvel2 = ((rvel*2) + 1 random)-rvel;
    }

    Thank you!

    the two errors are failures to initialize xvel and yvel.  use:

    c = 0;
    totalParticles = 100;
    While (c
    c ++ ;
    duplicateMovieClip ("particle0", "particle" + c, c);
    }

    And this is the script in the subject of the film:

    onClipEvent (enterFrame) {}
    r ++ ;
    Yvel +=(yvel2-yvel)/10;
    xvel +=(xvel2-xvel)/10;
    If (r == as) {}
    As = minVal + Random (RND);
    r = 0;
    yvel2 = ((rvel*2) + 1 random)-rvel;
    xvel2 = ((rvel*2) + 1 random)-rvel;
    }
    _x += xvel;
    FLF += yvel;
    }
    onClipEvent (load) {}

    r = 0;

    xvel = 0;

    Yvel = 0;

    _xscale = _yscale = 10 + random (50);
    _x = random (Stage.width);
    FLF = random (Stage.width);
    minVal = 25;
    RND = 25;
    As = minVal + Random (RND);
    rvel = 1;
    yvel2 = ((rvel*2) + 1 random)-rvel;
    xvel2 = ((rvel*2) + 1 random)-rvel;
    }

    Thank you!

  • Question about the use of JavaScript in Managed Bean

    Hello

    I have two questions... The reason for these questions is: we have a requirement that we have executed successfully using jsp and javascript. Now, we are unable to be implemented using the framework of the ADF. It is why would have a jsp with javascript page to reach the requirement.

    The condition is:
    1. to print a page. This page should be displayed with a customer bills. If the customer has 3 invoices (html content), these 3 bills needs displayed on the screen with a page break.
    2. because the page has a lot of data, certainly there will be a right of the page scroll bar to scroll down to see the data.
    3. now, the user clicks on the file--> print available on the browser / provided a "print" button with < af:showPrintablePageBehavior / >. When this happens, it is able to print the data that is displayed on the screen, not all 3 bills.

    This kind of requirement we already implemented using legs force Framework(jsp,java script).

    Now my question to you is:
    how we can open a new window bowser using java from a managed bean script.
    Let me know if you need more information about it.

    Thank you and best regards,
    Kiran kristelle

    the PDF version of the documentation:
    http://download.Oracle.com/docs/CD/E14571_01/Web.1111/b31973.PDF

    Kind regards
    Branislav

  • tried to send emails using the fast-forward button now e-mail flashes on and outside

    tried to send emails using the fast-forward button now e-mail flashes on and outside

    Please disconnect from the Internet temporarily, if necessary, by disabling a Wi - Fi connection or unplug Ethernet cable, whichever is applicable.

    In the Mail menu bar, select

    ▹ Connection Doctor window

    Look for the email account (SMTP) out in the window that opens. Double-click it. Another window opens, displaying the list of all outgoing mail accounts. We'll pick the one affected. Make a note of the settings. Click the sign to remove, and then click OK.

    Reconnect to the Internet and add the account back with the same settings.

  • How to access the camera in the Blackberry Playbook using Adobe Air SDK (in Flash builder Burrito)

    Hi all

    How to access the camera in the Blackberry Playbook using Adobe Air SDK (in Flash builder Burrito).

    Provide me with examples of coding please.

    Thanks in advance.

    With respect,

    Sampath

    Not possible yet. See http://docs.blackberry.com/en/developers/deliverables/21880/Known_issues_1360895_11.jsp

  • How to: save pictures of the Player library to use on another computer portable flash

    I just got a new laptop with Windows 7.  I had to download some photos that I need a disc because I need it for something that I do on my old computer.  Dvd/cd player to my computer old/burner left suddenly.  So, I want to save these photos on a flash drive which I can then use it on my old laptop.  But I have been unable to do and cannot find any help anywhere on how to do it.  My photos are in "my pictures" and he doesn't seem to be any way to get the in the new laptop on this flash drive.  I'm so frustrated on this issue - I tried all day working on it!  Can anyone help?  Thank you.

    Go to your pictures library,

    Insert the flash drive, it will be generally displayed by the name of the flash player and a drive letter F /... or peripheral mass storage.

    Drag your folder or folders on this list on the tree of files, devices

    Once you have all your files on this device,

    Right-click on the device list and select eject.

    Fact.

  • Hi, when I connect to my Wired XBOX 360 controller to my PC the guide button flashes once and there is no answer. I use 32 bit Windows 7, Dual core 2 GB Ram DDR2

    Hi, when I connect to my Wired XBOX 360 controller to my PC the guide button flashes once and there is no answer. I use 32 bit Windows 7, Dual core 2 GB Ram DDR2

    Hi JamBoard,

    It is possible, that you need to install the drivers for the controller.  You can get them from here:

    http://www.Microsoft.com/hardware/en-us/p/Xbox-360-controller-for-Windows#support

    However, if it's not too hot, it could be a real hardware problem.

    Thank you!

  • Use of javascript within the page fragment

    Im trying to use javascript code within a fragment of a page with the tag

    AF:resource

    But the second time the page reloads I got this error: "ReferenceError: works is undefined"

    <af:resource type="javascript">
          function funciona() {
              alert(123);
          }
    </af:resource>
    

    IM using JDeveloper 12 c

    Check the 'witch hunt during the use of JavaScript in the regions of the ADF' in this document http://www.oracle.com/technetwork/developer-tools/adf/learnmore/march2012-otn-harvest-1571998.pdf

    Timo

  • I installed the latest version of flash player and it said installed successfully and I can use it very well, but when I checked the system requirements do not match. She required 2.33 ghz and I 2.13 ghz. then that cause problems on my computer? I h

    I installed the latest version of flash player and it said installed successfully and I can use it very well, but when I checked the system requirements do not match. She required 2.33 ghz and I 2.13 ghz. then that cause problems on my computer? I have an intel i3 proccessor, windows 7, internet Explorer.

    All processors Intel i3 having at least 2 hearts, your specifications far exceed the requirements; See http://ark.intel.com/products/family/75025#@All

    I have some computers with much slower processors, and Flash Player 14 works perfectly well on them also.

Maybe you are looking for

  • send a Web page by e-mail

    I want to share a location of Web site by e-mail while I'm on Firefox. How do I do that?

  • Low volume during calls

    I have the latest update and I have an iPhone 6. This started last week where I can barely hear the other person during a call. The volume is set to high. Before that I would leave it to halfway to the top, and it was very good. I reset my phone and

  • Microphone does not work well when recording video to work

    For the last few months, my phone has this kind of problem whenever I wanted to record a video. The audio in the recorded video may not be heard clearly, even with the highest volume. There sounds caring as wind noise even though I'm far from any sou

  • Printing problem with rain on pro printing studio

    Hello world I have the printer pro100 for 2 weeks. I could make a few nice prints from the impression of Lightroom (5.7) module using my wireless network. I just recently added the "pro printing studio" plugin, but I can't make an impression. Once th

  • How Google Cloud AWS and Windows Azure to compare to another?

    I am quite familiar with AWS, MS Azure, Google Compute engine and have used Linux virtual machines in three environments without any problem. I often hear this argument: use of blue if you're a .NET shop, otherwise use AWS. I plead for more details.