I tried for hours. Shy of posting more boneheaded questions.. but I am giving up.. I am getting this error...
---------
The following JavaScript error(s) occurred:
At line 107 of file "Export Layout For Corona.jsfl":
TypeError:frameArray[0].elements[0] has no properties
---------
I am doing a very stripped down version, just like in the tutorial except from scratch...
[folder]background
[symbol]background
[folder]buttons
[button]play_btn
[MC]play_down
[MC]play_up
After a while of clicking I got it work, but it appears that I had the actual symbol 'background' selected when it created the .lua (I notice it creates a file now, instead of CTRL-C/CTRL-V of the code in this version)
So then I noticed when I selected all the individual elements it does make 4 different .lua files.
layout_play_btn.lua
layout_beckground.lua
layout_play_up.lua
layout_play_down.lua
ug. This doesn't seem correct. I thought it was supposed to just make one file but if I don't select those then I get that error.
Is there anyway I can just merge these 4 and get going? Looks like I am getting a whole lot of nil
here is an example of the layout_play_btn.lua I got it to export by having it selected when I did the Comands/Export Layout to Corona (the only way I can get that script to do something)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | local loqbutton = require("loq_ui_button") local groups = nil -- The containers for elements on the stage. They are either the layer groups or element groups. local dimensions = nil -- The dimensions of the container groups. local elements = nil -- The elements in the element groups; either sprites or buttons referencing sprites. local function createLayout(_spriteFactory) assert(_spriteFactory ~= nil, "Error in createLayout: _spriteFactory argument cannot be nil") -- layout0 groups = {} dimensions = {} elements = {} local group = nil groups['layout0'] = display.newGroup() -- new group groups['Layer 1'] = display.newGroup() groups['layout0']:insert(groups['Layer 1']) -- new sprite elements._element0 = _spriteFactory:newSpriteGroup("play_up") group = elements._element0 groups['_element0'] = group group.elementName = '_element0' group.libraryName = "play_up" groups['Layer 1']:insert(group) group.x = -86 group.y = -28 dimensions['_element0'] = {width = 172, height = 56} -- end layout0 return {groups = groups, dimensions = dimensions, elements = elements} end local function removeElements(_elementGroup) local i = _elementGroup.numChildren while i > 0 do _elementGroup[i]:removeSelf() i = i - 1 end _elementGroup:removeSelf() end local function clearLayout() removeElements(groups['_element0']) groups['Layer 1']:removeSelf() groups['layout0']:removeSelf() groups = nil dimensions = nil elements = nil end return { createLayout = createLayout, clearLayout = clearLayout } |
Hi,
The video tutorial is out of date with the latest layout exporter. If you want to export the current layout on screen, deselect everything in the library and then export the layout. If you want to export a layout for a specific symbol or multiple symbols you can select it from the library.
When I free up some time I'll need to shoot another video.
um. ok. But when I do that it throws the error. This was the only way I could get anything to actually export. But the export of your sample works... So it must be something I am doing? I'll keep clicking around and see if I can't figure it out.
If you want send the fla to support and let me know what it is you want to export, and I'll help pinpoint what's wrong.
Hey Eric,
Can you edit this post and set it to resolved? For example: "my Export Layout to Corona fail...help [[Resolved]]". Thanks.
For anyone else reading his issue was that his buttons had multiple layers the first of which was empty. The Spriteloq layout exporter bombed when it couldn't find anything in the button's up state.