Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Why is parameter.width nil
Started by sidermaniac May 11 2018 03:41 PM

1 reply to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

sidermaniac

[GLOBAL: userInfoPane.html]
sidermaniac
  • Observer

  • 4 posts
  • Corona SDK

The following code prints 'nil'. Why isn't it printing a value? 

local function test(mytext)
	print(mytext.width)
end 

test("moo")

Edit:

Oops, I think I know.  

mytext is not a display object therefore it hasn't got the width property.  

Sorry to bother you. 



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 6,404 posts
  • Corona SDK

1 - mytext does not exist.

 

2- Or it has been removed and you're passing a handle to the stub.

 

OR

 

3. You want mytext.contentWidth




[topic_controls]
[/topic_controls]