Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - stepstream

Pages: 1 2 3
1
Ask a Question / Re: Trouble with REST GET and POST
« on: March 03, 2013, 10:58:47 am »
Aha! It was just a Flash security settings issue.

http://www.stencyl.com/help/view/web-flash-security/

2
Ask a Question / Trouble with REST GET and POST
« on: March 03, 2013, 08:33:43 am »
Hello!

I'm having trouble getting a response back from my REST API within Stencyl and I don't know where else to turn!

I have a simple REST API for my site that deliver's a user's current points at http://steplab.org/REST/points/1 (for user 1) http://steplab.org/REST/points/2 (for user 2) etc. I can then post points using a POST call to the same URL once the user finishes my game.

If I load the REST get URL in my browser, I see the correct response (user 1 has 6967 points). But when I load this into Stencyl, I get nothing. What am I doing wrong? I suspect it's something really simple but I can't see it.

Any help would be great!


PS the "getresponse" attribute is a text object, but I've also tried a number object. Neither appears to get updated (I have another event that draws them on the screen)

3
Completed / Re: Load external image for actor (3.0)
« on: January 28, 2013, 07:25:26 am »
OK I've finally gotten to look at this, and I think I'm close but I'm having a dumb moment about variable scope in Haxe. Here's what I've got:

Code: [Select]
class Design_2_2_ extends ActorScript
{         
//Expose your attributes like this
//Need further help? See: http://www.stencyl.com/help/view/code-mode/
//@:attribute("id='1' name='Display Name' desc='An Attribute'")
//public var attributeName:String;
 
override public function init()
{
var picLoader = new Loader();
var spritePic = picLoader.load(new URLRequest("https://www.stephealth.us/game/avatarsample.png"));

}

public inline function update(elapsedTime:Float)
{
}

public inline function draw(g:G)
{
g.drawImage(spritePic, 0, 0);
}

But of course the draw function doesn't know what spritePic is, since it's a local variable to the init function. Any help? Apologies for my ignorance!

4
Ask a Question / Re: Importing images.
« on: January 24, 2013, 02:30:54 pm »
Alright I solved it myself, although I still don't quite understand why.

The key was to simply pass the game attribute in the URLrequest. Now that I'm getting the specific URL from a game attribute, I can dynamically load whichever URL I need at the moment. Hooray!

5
Ask a Question / Re: Importing images.
« on: January 24, 2013, 02:08:04 pm »
Hello again,

So I'm stuck again (big surprise I know) because when I include the following in the LoadSprite class, I get a ton of weird Stencyl errors.

Code: [Select]
public var tryagain:String = getGameAttribute("imagefile") as String;
I've also tried it as
Code: [Select]
public var tryagain:String = getGameAttribute("imagefile");
The weird thing is this works fine in my custom scene behaviors, (and I have verified that the game attribute is set before the actor is invoked) but it doesn't work at all in this actor behavior. I could also do a workaround by getting an actor attribute, but I don't know the code to do that.

Any thoughts?

Thanks again,

Andrew

6
Ask a Question / Re: Importing images.
« on: January 24, 2013, 01:16:39 pm »
Oh that's what I meant to say. I think I'll take a short sanity break and come back to it!

Thanks  :D

7
Ask a Question / Re: Endless Runner/ Terrian Generating?
« on: January 24, 2013, 01:01:53 pm »
Hello!

So the main idea with an "endless runner" game is to use one scene and then create "actors" as the terrain. You generate them off-screen to the right (making sure to set them as "always simulating" and "cannot be moved") and then set a negative x-speed for them. That way they'll start moving left.

Did that help?

8
Ask a Question / Re: Importing images.
« on: January 24, 2013, 12:58:44 pm »
OK I've got it working on my server. Now I just have to figure out how to replace the static string with one of my global attribute strings so I can dynamically set the image file to load (weirdly, "setGameAttribute" isn't loading for me).

Have you had any success doing something similar?

Andrew

9
Completed / Re: Load external image for actor (3.0)
« on: January 24, 2013, 12:52:59 pm »
Thanks! I finally got the External Sprite Loader (Stencyl 2.X) to bend to my will, so I'll stick with that for now and come back to this once I port over to Stencyl 3.


10
Ask a Question / Re: Importing images.
« on: January 24, 2013, 10:35:52 am »
IT WORKED!!!

I adjusted it to match a local file on my computer, and it loaded perfectly! Now I'm going to see if I can get it working on my server.

THANKS A MILLION.

11
Ask a Question / Re: Importing images.
« on: January 24, 2013, 10:29:38 am »
Thanks so much.

Yeah I have a remote server where the SWF will sit, and it just needs to pull images from relative URLs, so the cross-domain thing should hopefully not be a problem. I'll take a look at your sample and report back. Thanks again for being awesome and helpful!

-Andrew

12
Ask a Question / Re: Importing images.
« on: January 24, 2013, 09:52:32 am »
Thanks!

13
Ask a Question / Re: Importing images.
« on: January 24, 2013, 09:47:48 am »
So I commented out those lines and now Stencyl2 is refusing to compile to Flash. It says to check my logs but I can't find anything strange in the logs.

I'm just trying to load an external image onto a scene from my server, as an actor.

Don't suppose I could see a game you've made to try and figure out what I'm doing wrong?

Thanks,


14
Ask a Question / Re: Importing images.
« on: January 24, 2013, 09:33:39 am »
OK I'll comment out the lines and report back. Fingers crossed!

15
Ask a Question / Re: Help with layers
« on: January 24, 2013, 09:32:46 am »
Yes that's what I ended up doing. Seems a bit hacky though.

Pages: 1 2 3