Questions about scheduler and it's use on room level

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Questions about scheduler and it's use on room level

Post by rjgtav »

If you trace the extension, does it return null?
Like: trace(room.getExtManager().getExtension("room_ext"));
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
yuvallahav
Posts: 247
Joined: 07 Oct 2008, 13:03
Location: Rome, Italy
Contact:

Re: Questions about scheduler and it's use on room level

Post by yuvallahav »

Found it!
So, tracing and going over the getExtManager object, I noticed there is no getExtension method to it, but there is a get method, and that one worked, and now I can reach my extension, now I just need to see there is no crossing from room to room, that he fires off the right function only in the mentioned room, and not any other...

Thanks a bunch rjgtav!!
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Questions about scheduler and it's use on room level

Post by Lapo »

If nothing happens you are probably dealing with a null object somewhere in your chain of calls.
Please remember that calling a method on a null object in javascript/actionscript doesn't throw any exceptions.
I would start by making sure that this line works:

Code: Select all

zone.getRoom(from_room).getExtension("room_ext").handleInternalRequest(event);
Check that each returned object is not null. Something might not be working correctly.
Lapo
--
gotoAndPlay()
...addicted to flash games
yuvallahav
Posts: 247
Joined: 07 Oct 2008, 13:03
Location: Rome, Italy
Contact:

Re: Questions about scheduler and it's use on room level

Post by yuvallahav »

Thanks Lapo, at the end what worked was:

zone.getRoom(from_room).getExtManager().get("room_ext").handleInternalRequest(event);

it would seem that zone.getRoom(from_room).getExtension("room_ext") is returned empty, the system won't even trace it, and also:

zone.getRoom(from_room).getExtManager().getExtension("room_ext").handleInternalRequest(event) does not work, but:

zone.getRoom(from_room).getExtManager().get("room_ext").handleInternalRequest(event) works just fine.

It's a little confusing when you have 2 completely different syntax for doing the same action on the zone level and and on the room level.
Post Reply