00:00
00:00
Newgrounds Background Image Theme

Junkerkota just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Flash Cs5 JSFL find

1,129 Views | 1 Reply
New Topic Respond to this Topic

Flash Cs5 JSFL find 2016-06-04 16:19:02


When I run this script from http://help.adobe.com/en_US/flash/cs/extend/WS5b3ccc516d4fbf351e63e3d118a9024f3f-7fb0CS5.html
as simple command

var nameToSearchFor = "instance01";   
    var doc = fl.getDocumentDOM();   
    var results = fl.findObjectInDocByName(nameToSearchFor, doc);   
    if (results.length > 0) {   
      alert("success, found " + results.length + " objects");   
    }   
    else {    
      alert("failed, no objects named " + nameToSearchFor + " found");   
    }

everything is ok, but when I want add this code to custom tool i got errors.

Error Script in function mouseDown

function configureTool() {  
    theTool = fl.tools.activeTool;  
    theTool.setToolName( "Sew" );  
    theTool.setIcon( "Sew.png" );  
    theTool.setMenuString( "Sew" );  
    theTool.setToolTip( "Sew" );  
    theTool.setOptionsFile( "Sew.xml" );  
    theTool.setPI( "shape" );  
      
    }  
      
      
    function activate(){  
    fl.trace("ACTIVATE");  
    }  
      
      
      
    function mouseDown(){  
      
    var nameToSearchFor = "instance01";   
      
    var doc = fl.getDocumentDOM();   
      
    var results = fl.findObjectInDocByName(nameToSearchFor, doc);   
      
    if (results.length > 0) {   
      
      fl.trace("successfound");   
      
    }   
      
    else {    
      
      fl.trace("failed");   
      
    }  
      
    }  
      
      
    function deactivate() {  
    fl.trace("End");  
    }

Why?

Response to Flash Cs5 JSFL find 2016-08-03 14:16:07 (edited 2016-08-03 14:16:21)


At 7/20/16 04:38 PM, SB-Anims wrote: Hehe... Viruz

In flash folder scripts i found solution