[Extendflash] Weird bug with component instanses properties
Constantiner
ruflash at gmail.com
Thu Mar 16 12:20:22 GMT 2006
Hello!
My target is place components from library on stage, arrange them and
set components properties. But in real world (with Flash 8 and Flash
MX 2004) placing and positioning is not a problem but setting
components params like a headache.
During placing components some of them has "parameters" property
length under component parameters, but some of them has 0 properties
:(
For example:
- my jsfl
var horizontalSize = 1024;
var verticalSize = 768;
var horizontalItems = 25;
var verticalItems = 20;
var itemWidth = horizontalSize / horizontalItems;
var itemHeight = verticalSize / verticalItems;
var dom = fl.getDocumentDOM();
dom.selectNone ();
fl.outputPanel.clear();
dom.width = horizontalSize;
dom.height = verticalSize;
var linkageID = "test";
for (var i = 0; i < horizontalItems; i ++)
{
for (var j = 0; j < verticalItems; j ++)
{
placeOrDead (linkageID, itemWidth, itemHeight, i, j);
}
}
function placeOrDead (linkage, width, height, firstIndex, secondIndex)
{
var dom = fl.getDocumentDOM();
var lib = dom.library;
lib.selectItem (linkage);
var xPos = firstIndex * width;
var yPos = secondIndex * height;
lib.selectItem (linkage);
lib.updateItem ();
var success = lib.addItemToDocument ({x: xPos, y: yPos});
var aCell;
if (success)
{
aCell = dom.selection [0];
fl.trace (aCell.parameters.length);
var transformationPoint = dom.getTransformationPoint ({x: 0, y: 0});
dom.setTransformationPoint ({x: 0, y: 0});
dom.moveSelectionBy (transformationPoint);
aCell.width = width;
aCell.height = height;
dom.selectNone ();
}
}
- my component
class Test extends MovieClip
{
[Inspectable(defaultValue="foo")]
public var foo:String;
function Test ()
{
}
}
Component plased in library with test linkageID. After launching jsfl
script trace result is:
0
1
0
1
0
1
1
0
1
0
1
1
0
....
How can I achieve results I need?
My sources are attached.
Thanks for advance.
--
Best regards,
Constantiner mailto:ruflash at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.fla
Type: application/octet-stream
Size: 22528 bytes
Desc: not available
Url : http://lists.flashguru.co.uk/pipermail/extendflash/attachments/20060316/618f2b5b/test-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test.as
Type: application/octet-stream
Size: 132 bytes
Desc: not available
Url : http://lists.flashguru.co.uk/pipermail/extendflash/attachments/20060316/618f2b5b/Test-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arrange_cells.jsfl
Type: application/octet-stream
Size: 1235 bytes
Desc: not available
Url : http://lists.flashguru.co.uk/pipermail/extendflash/attachments/20060316/618f2b5b/arrange_cells-0001.obj
More information about the Extendflash
mailing list