Positioning a group that's in another group

I’m splitting up my code into modules, since it’s getting a bit unwieldy for me. One of the modules (deck.lua) puts together some sprites in a group and returns that group.

In the scene lua file where everything should appear, I create a new instance of this group and then add it to the local group. Here’s what it looks like:

function scene:createScene( event )  
 local group = self.view  
  
 local cardDeck = deck.new(20)  
 cardDeck.x = 50  
 group:insert(cardDeck)  
  
end  

The problem is that setting cardDeck.x doesn’t do anything. I can set it to 0, 50, 200, whatever without a change. The sprites show up, but I can’t seem to position them.

What am I doing wrong? [import]uid: 136105 topic_id: 24384 reply_id: 324384[/import]

Can you post up some of the code for Deck.new() please. I suspect the issue lays there [import]uid: 84637 topic_id: 24384 reply_id: 98566[/import]

Here’s the deck.new function. It’s broken down to the essentials and am still having the issue.

function deck.new(numCards)  
 local newDeck = display.newGroup()  
  
 newDeck.currentIndex = 1  
 newDeck.nextIndex = 2  
 newDeck.cardSet = createDeck(numCards)  
 local currentCard = newDeck.cardSet[newDeck.currentIndex]  
 local nextCard = newDeck.cardSet[newDeck.nextIndex]  
  
 -- show the right side of the cards  
 local nextCardR = cardSprites:grabSprite(nextCard, true)  
 nextCardR.x = nextCardR.contentWidth\*0.5  
 newDeck:insert(nextCardR)  
 local currentCardR = cardSprites:grabSprite(currentCard, true, {flip={1,5,flipTime,1}})  
 currentCardR.x = currentCardR.contentWidth\*0.5  
 newDeck:insert(currentCardR)  
  
 return setmetatable(newDeck, deck\_mt)  
end  

createDeck() returns a table of strings that coinside with sprites in my spritesheet. I’m using SpriteGrabber. No errors appear in the console.

Thanks. [import]uid: 136105 topic_id: 24384 reply_id: 98590[/import]