Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

cant figure out why
Started by babybeanie98 Aug 19 2012 10:47 AM

- - - - -
60 replies to this topic
[TOPIC CONTROLS]
Page 3 of 3 1 2 3
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#51

babybeanie98

[GLOBAL: userInfoPane.html]
babybeanie98
  • Contributor

  • 151 posts
  • Corona SDK

How should I send you the zip file so that you can help me fix this ongoing headache? :(
uid: 69302 topic_id: 30033 reply_id: 121035


[TOPIC: post.html]
#52

Omnigeek Media

[GLOBAL: userInfoPane.html]
Omnigeek Media
  • Corona Geek

  • 2,975 posts
  • Corona SDK

You can either email it, or use something like DropBox to share it.

And just to make sure... Your level1.lua is really called leve1.lua (same capitalization).

I think I'm with Paul_G, its time to see your whole project. The code you posted above doesn't seem to have any obvious errors, though other things could be causing it.

uid: 19626 topic_id: 30033 reply_id: 121038


[TOPIC: post.html]
#53

babybeanie98

[GLOBAL: userInfoPane.html]
babybeanie98
  • Contributor

  • 151 posts
  • Corona SDK

Just tell me where to send it and I will sent it. email/dropbox its getting to a point of frustation. I designed and interactive program for class and that wasn't this difficult.
uid: 69302 topic_id: 30033 reply_id: 121039


[TOPIC: post.html]
#54

Omnigeek Media

[GLOBAL: userInfoPane.html]
Omnigeek Media
  • Corona Geek

  • 2,975 posts
  • Corona SDK

put it on drop box and share it with me rob at robmiracle dot com and I'll see what I can do. But Paul_G offered to look at it first, so it would be best if you tried to work out something with him.

uid: 19626 topic_id: 30033 reply_id: 121045


[TOPIC: post.html]
#55

babybeanie98

[GLOBAL: userInfoPane.html]
babybeanie98
  • Contributor

  • 151 posts
  • Corona SDK

Ok guys here is the dropbox link https://www.dropbox.com/s/cqe6bdm42ds70aw/Forgetful%20Memory.zip

Ok so what is suppose to happen is that the user clicks on the test button at the bottom of the about us and it takes them to the next screen, then there will be a text field where they enter information, at the bottom of that will be another button (send) to transmit the information.
uid: 69302 topic_id: 30033 reply_id: 121088


[TOPIC: post.html]
#56

Omnigeek Media

[GLOBAL: userInfoPane.html]
Omnigeek Media
  • Corona Geek

  • 2,975 posts
  • Corona SDK

Okay, here are my fixes.

-- main.lua --
-----------------------------------------------------------------------------------------
--
-- main.lua
--
-----------------------------------------------------------------------------------------

-- hide the status bar
display.setStatusBar( display.HiddenStatusBar )

-- include the Corona "storyboard" module
local storyboard = require "storyboard"

 -- load menu screen
storyboard.gotoScene( "menu" )

Notice I moved all of your things you were creating here to your menu scene. Since your items were not in a display group, they are not being managed by storyboard. main.lua typically holds setup stuff.

-- menu.lua
-----------------------------------------------------------------------------------------
--
-- menu.lua
--
-----------------------------------------------------------------------------------------

local storyboard = require( "storyboard" )
local scene = storyboard.newScene()

-- include Corona's "widget" library
local widget = require "widget"

--------------------------------------------

-- forward declarations and other locals
local playBtn

-- 'onRelease' event listener for playBtn
local function onPlayBtnRelease()
	print("goto scene")
	-- go to level1.lua scene
	storyboard.gotoScene( "level1")
	
	return true	-- indicates successful touch
end

-----------------------------------------------------------------------------------------
-- BEGINNING OF YOUR IMPLEMENTATION
-- 
-- NOTE: Code outside of listener functions (below) will only be executed once,
--		 unless storyboard.removeScene() is called.
-- 
-----------------------------------------------------------------------------------------

-- Called when the scene's view does not exist:
function scene:createScene( event )
	local group = self.view

	local background = display.newRect(0,0,display.contentWidth,display.contentHeight)
	background:setFillColor(0,0,0)
	group:insert(background)
	
	local myText1= display.newText("ABOUT US", 0, 0, native.systemFont, 32)
	--myText1.text = "Or you can change the text here"
	myText1.x = display.contentWidth /2;
	myText1.y = display.contentHeight /6;
	myText1:setTextColor(255, 0, 0)
	group:insert(myText1)
	 
	local myText2= display.newText("this simply a test", 0, 0,200, 200, native.systemFont, 16)
	myText2.x = display.contentWidth /2;
	myText2.y = myText1.y + myText1.contentHeight /2 + myText2.contentHeight /2;
	myText2:setTextColor(255, 255, 255)  	
	group:insert(myText2)

	-- create a widget button (which will loads level1.lua on release)
	playBtn = widget.newButton{
		label="test",
		labelColor = { default={255}, over={128} },
		default="button.png",
		over="button-over.png",
		width=160, height=40,
		onRelease = onPlayBtnRelease	-- event listener function
	}
	playBtn:setReferencePoint( display.CenterReferencePoint )
	playBtn.x = display.contentWidth*0.5
	playBtn.y = display.contentHeight - 125
	
	-- all display objects must be inserted into group
	--group:insert( background )
	--group:insert( titleLogo )
	group:insert( playBtn )
end

-- Called immediately after scene has moved onscreen:
function scene:enterScene( event )
	local group = self.view
	
	-- INSERT code here (e.g. start timers, load audio, start listeners, etc.)
	
end

-- Called when scene is about to move offscreen:
function scene:exitScene( event )
	local group = self.view
	
	-- INSERT code here (e.g. stop timers, remove listenets, unload sounds, etc.)
	
end

-- If scene's view is removed, scene:destroyScene() will be called just prior to:
function scene:destroyScene( event )
	local group = self.view
	
	if playBtn then
		playBtn:removeSelf()	-- widgets must be manually removed
		playBtn = nil
	end
end

-----------------------------------------------------------------------------------------
-- END OF YOUR IMPLEMENTATION
-----------------------------------------------------------------------------------------

-- "createScene" event is dispatched if scene's view does not exist
scene:addEventListener( "createScene", scene )

-- "enterScene" event is dispatched whenever scene transition has finished
scene:addEventListener( "enterScene", scene )

-- "exitScene" event is dispatched whenever before next scene's transition begins
scene:addEventListener( "exitScene", scene )

-- "destroyScene" event is dispatched before view is unloaded, which can be
-- automatically unloaded in low memory situations, or explicitly via a call to
-- storyboard.purgeScene() or storyboard.removeScene().
scene:addEventListener( "destroyScene", scene )

-----------------------------------------------------------------------------------------

Basically I just moved your display bits here. Everything else was pretty much unchanged.

-- level1.lua --

-----------------------------------------------------------------------------------------
--
 --level1.lua

local storyboard = require( "storyboard" )
local scene = storyboard.newScene()

-----------------------------------------------------------------------------------------
-- BEGINNING OF YOUR IMPLEMENTATION
-- 
-- NOTE: Code outside of listener functions (below) will only be executed once,
--               unless storyboard.removeScene() is called.
-- 
-----------------------------------------------------------------------------------------

-- Called when the scene's view does not exist:
function scene:createScene( event )
        local group = self.view
 
        -- create a grey rectangle as the backdrop
        local bg = display.newRect( 0, 0, display.contentWidth, display.contentHeight )
        bg:setFillColor( 255 )
        group:insert(bg)
        bg.x = display.contentWidth * 0.5;
        bg.y = display.contentHeight * 0.5;
        
 
        local font = native.systemFont;
 
        local label = display.newText("Tap here to send a text", 0, 0, font, 18) ;
        label:setReferencePoint(display.CenterReferencePoint);
        label:setTextColor(0, 0, 0) ;  
        label.x = display.contentWidth * 0.5;
        label.y = display.contentHeight * 0.5;

        group:insert(label)
        --label.x = _W * 0.5;
        --label.y = _H - 50;
 
        function label:tap(e)
                native.showAlert("Tapped","Got Here",{"Ok"})
                native.showPopup("sms",{
                        body = "I sent this text from my app",
                        --to = {"5550000000"} -- or "5550000000" if this doesn't work
                }) ;
        end
 
        label:addEventListener("tap", label);
 end

-----------------------------------------------------------------------------------------
-- END OF YOUR IMPLEMENTATION
-----------------------------------------------------------------------------------------

-- "createScene" event is dispatched if scene's view does not exist
scene:addEventListener( "createScene", scene )

-- "enterScene" event is dispatched whenever scene transition has finished
scene:addEventListener( "enterScene", scene )

-- "exitScene" event is dispatched whenever before next scene's transition begins
scene:addEventListener( "exitScene", scene )

-- "destroyScene" event is dispatched before view is unloaded, which can be
-- automatically unloaded in low memory situations, or explicitly via a call to
-- storyboard.purgeScene() or storyboard.removeScene().
scene:addEventListener( "destroyScene", scene )

-----------------------------------------------------------------------------------------

return scene

There are several errors in here still. The error you were experiencing was a mis-placed "end". You're createScene() had a commented out end and there was an end at the very end of the file. This kind of error will typically throw and error that is bogus.

You were also creating a 0x0 background and passing screenW and screenH as unecessary parameters. I fixed that.

You were also dividing the width by 0.5 which is really the same as multiplying by 2 which was pushing your content off the screen.

uid: 19626 topic_id: 30033 reply_id: 121094


[TOPIC: post.html]
#57

Paul_G

[GLOBAL: userInfoPane.html]
Paul_G
  • Enthusiast

  • 53 posts
  • Corona SDK

paul a paulite dot DE
is my email if you're still interested
uid: 98393 topic_id: 30033 reply_id: 121143


[TOPIC: post.html]
#58

babybeanie98

[GLOBAL: userInfoPane.html]
babybeanie98
  • Contributor

  • 151 posts
  • Corona SDK

I am very insterested in all help. But paul_g I have been sitting here trying to figure out how to send you the file based off paul a paulite dot DE. and I have no clue.
uid: 69302 topic_id: 30033 reply_id: 121148


[TOPIC: post.html]
#59

Omnigeek Media

[GLOBAL: userInfoPane.html]
Omnigeek Media
  • Corona Geek

  • 2,975 posts
  • Corona SDK

That's his e-mail address:

paul a paulite dot DE

substitute the " a " for "@" and the " dot " for a "." leaving out the spaces.

Its the way people post their email addresses so spambots don't pick them up. If he had typed it like:

spamme@mywebsite.de

then he opens himself up to excessive spam.

@Paul_G you should be able to grab the project from the dropbox link posted above.
uid: 19626 topic_id: 30033 reply_id: 121154


[TOPIC: post.html]
#60

Paul_G

[GLOBAL: userInfoPane.html]
Paul_G
  • Enthusiast

  • 53 posts
  • Corona SDK

add
return scene
at end of rob's menu.lua

for me, everything is working
uid: 98393 topic_id: 30033 reply_id: 121170


[TOPIC: post.html]
#61

babybeanie98

[GLOBAL: userInfoPane.html]
babybeanie98
  • Contributor

  • 151 posts
  • Corona SDK

OMG, you guys ROCK!!!. I would never would have figured this out without you. I don't know many times I can say THANK YOU. THANK YOU,THANK YOU THANK YOU!!!!!!!!
uid: 69302 topic_id: 30033 reply_id: 121250



[topic_controls]
Page 3 of 3 1 2 3
 
[/topic_controls]