Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-18-2008, 08:38 AM   #1
svdelle
Registered User
 
Join Date: Jun 2005
Posts: 19
Default Enter editMode after convertToSymbol?

This is JSFL in case you were wondering ...

I'm adding tons of 'Groups' to the library using:
Code:
var allElements = fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements;
var selectionArray = new Array;
for(var i=0;i < allElements.length;i++){
     fl.getDocumentDOM().selectNone();
     selectionArray[0] = allElements[i];
     fl.getDocumentDOM().selection = selectionArray;
     if(allElements[i].elementType != "instance") // Leave  MCs alone
     {
          // Add symbol to library (with default name 'instance1' etc.)
          fl.getDocumentDOM().convertToSymbol("movie clip", "", "top left");
		
/*
How do I:
1. Enter editMode on newly created symbol?
2. Add new layer in symbol (as the bottom layer, as I'm trying to expand the clickable area below a letter shape)
3. Draw rect, something like this ...
     newly_added_mc.addNewRectangle({left:0, top:0, right:st.width, bottom:st.height}, 0);
     newly_added_mc.selectAll();
     newly_added_mc.breakApart();
     newly_added_mc.setFillColor("#000000");
     newly_added_mc.setStroke("#00000000", 1, "solid");
     newly_added_mcselectNone();
     newly_added_mc.exitEditMode();
*/
	}
}

Last edited by svdelle; 09-18-2008 at 10:37 AM. Reason: JSFL note
svdelle is offline   Reply With Quote
Old 09-25-2008, 10:30 AM   #2
aravinth_vt
Registered User
 
Join Date: Mar 2006
Posts: 21
Default

Hi,

try this one

Code:
function main(){
	var allElements = fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements;
	var selectionArray = new Array;
	for(var i=0;i < allElements.length;i++){
	     fl.getDocumentDOM().selectNone();
	     selectionArray[0] = allElements[i];
	     fl.getDocumentDOM().selection = selectionArray;
	     if(allElements[i].elementType != "instance") // Leave  MCs alone
	     {
	          // Add symbol to library (with default name 'instance1' etc.)
			  var elem=allElements[i];
	          fl.getDocumentDOM().convertToSymbol("movie clip", "", "top left");
			  fl.getDocumentDOM().enterEditMode("inPlace");
			  fl.getDocumentDOM().getTimeline().addNewLayer("rect","normal",false);
			  fl.getDocumentDOM().addNewRectangle({left:0, top:0, right:elem.width, bottom:elem.height}, 0);
			  fl.getDocumentDOM().exitEditMode();
		}
	}
}
main()
aravinth_vt is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Enter Key for Dynamic Text Field eb110k ActionScript 2.0 1 10-17-2007 08:45 AM
disable Enter! rgpassey ActionScript 2.0 3 07-23-2007 07:12 PM
Override the behavior for the ENTER key dannyst ActionScript 2.0 3 07-01-2005 02:13 PM
_focusRect, Enter, not the usual problem gmac63 ActionScript 2.0 4 07-01-2004 07:37 PM
Prevent ENTER from registering bjnova ActionScript 1.0 (and below) 0 06-22-2004 03:58 PM


All times are GMT. The time now is 01:31 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.