Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Extensions and Plugins > JSFL - Extending Flash

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-27-2005, 05:36 PM   #1
flapflap
Registered User
 
Join Date: Oct 2003
Posts: 5
Default Try to create layers but nothing appends

Here is my code

Code:
// CONFIG
var verbose=true; // Set verbose mode
var layerLabelsName="Labels"; // Name of layer for labels, if not find will be create
var layerLabelsId=-1; // The id of the layer for labels
var layerItemsName="Items"; // Name of layer where items will be placed, if not find will be create
var layerItemsId=-1; // The id of the layer for items
var folderAssetsName="Assets"; //Name of library folder for Assets, if not find will be create
var folderAssetsId=-1; // The id of the Assets folder
var frameExport=2; // Number of frame where items will be placed. If the Assets library folder have subfolders, each items will be create in a specific frame
// Make a echo action for trace that check verbose mode
function echo(msg){
	if(verbose){
		fl.trace(msg);
	}
}
// Methods used
// Check if an item is in a folder in the subFolders array
// @param item : reference to the item
// @return the id of the subfolder
function isInSubFolder(item){
	var subFolders_lg = subFolders.length;
	for(var i = 0; i<subFolders_lg; i++){
		if(item.name.indexOf(subFolders[i])>-1){
			return i;
		}
	}
	return null;
}
// MAIN
fl.outputPanel.clear ();
echo("-- CreateAsset Lib2Frame Starting --");
// Checking the layers
var timeline = fl.getDocumentDOM ().getTimeline();
var layers = timeline.layers;
var layers_lg= layers.length;
for(var i= 0; i<layers_lg; i++){
	if(layers[i].name==layerLabelsName){
		layerLabelsId = i;
	}else if(layers[i].name==layerItemsName){
		layerItemsId = i;
	}
}
if(layerItemsId==-1){
	layerItemsId = fl.getDocumentDOM ().getTimeline().addNewLayer(layerItemsName);
	echo("Creating layer for items : "+layerItemsName);
}
if(layerLabelsId==-1){
	layerLabelsId = fl.getDocumentDOM ().getTimeline().addNewLayer(layerLabelsName);
	echo("Creating layer for labels : "+layerLabelsName);
}
I don't get why my layer are not created... is you guys got some clue for me ?
flapflap 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


All times are GMT. The time now is 12:24 AM.


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