Lock scene

If you have created a unique MLServeCmd that performs a unique task, please post it here so others can learn from them.
tntwebguy
New Member
New Member
Posts: 33
Joined: Wed Nov 18, 2009 9:48 am
Contact:

Lock scene

Postby tntwebguy » Thu Jan 14, 2010 11:24 am

Is there a command I can put on a button that will "lock" and "unlock" the current scene the button is in...I want to have a certain scene "locked" until someone presses another button to "unlock" it

thanks
-TNT

User avatar
ronsatter
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1304
Joined: Mon Dec 04, 2006 1:40 am
Location: San Leandro, CA
Contact:

Re: Lock scene

Postby ronsatter » Thu Jan 14, 2010 2:21 pm

TNT,

There is no "Lock/Unlock" scene command in ML. You might be able to monitor scene exits by placing a MLConditional command in the "Scene Exit" options. Then before the scene can be exited, a message box would display, asking user permission to exit scene. I'm not certain this method will prevent other external ML commands from changing to a different scene without user permission.

Maybe other users have created a work-around for this.

Ron
If it ain't broke ... don't fix it!

tntwebguy
New Member
New Member
Posts: 33
Joined: Wed Nov 18, 2009 9:48 am
Contact:

Re: Lock scene

Postby tntwebguy » Thu Jan 14, 2010 2:55 pm

Ron,

How about this....is there an mlcommand to put the scene in "Design mode" That would be great...if I had a button that went into design mode, then the screen is locked... I would need a button to go into launch mode as well...

OR...a button to unload the navigation layer so a user can't navigate somewhere else...?

thanks
-TNT

User avatar
Flibblebot
New Member
New Member
Posts: 48
Joined: Sun Aug 23, 2009 6:37 am
Location: Wet and Wild Wales
Contact:

Re: Lock scene

Postby Flibblebot » Thu Jan 14, 2010 4:12 pm

ronsatter wrote:TNT,

There is no "Lock/Unlock" scene command in ML. You might be able to monitor scene exits by placing a MLConditional command in the "Scene Exit" options. Then before the scene can be exited, a message box would display, asking user permission to exit scene. I'm not certain this method will prevent other external ML commands from changing to a different scene without user permission.

Maybe other users have created a work-around for this.

Ron

If you set a variable on the server and then checked that using a MLConditional command, that might work. Set the variable when the scene opens, unset it when the scene exits or when a particular button is pressed and get all other scenes to check for that variable value before loading the scene or whatever.

I don't think there's a programmatic way of entering design mode (why would there be?) - perhaps if you describe exactly what you're wanting to do, then we may be able to suggest a suitable solution.

User avatar
mcascio
Founder
Founder
Posts: 8270
Joined: Tue Jan 28, 2003 4:03 pm
Location: Kenosha, Wi
Contact:

Re: Lock scene

Postby mcascio » Thu Jan 14, 2010 4:38 pm

How about using Text.Sizable and sizing it to your entire screen. Assign a variable to the label field. When the variable equals ON make it clickable...if it's on the top layer, user's won't be able to click anything behind it. If you set that variable to OFF, the through the States Panel, you can make the Text.Sizable object unclickable - providing access to any buttons behind it.
Mario Cascio
Cinemar, Inc.
http://www.cinemaronline.com

User avatar
ronsatter
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1304
Joined: Mon Dec 04, 2006 1:40 am
Location: San Leandro, CA
Contact:

Re: Lock scene

Postby ronsatter » Thu Jan 14, 2010 11:27 pm

Keeping the user from navigating away from the scene is only half the problem. Some macro with a changeScene command could be executed automatically in a MLTimer or other reason, and still cause the scene to exit. Setting a variable and using MLConditional in the "Exit Scene" option to check the variable before exit would be a more elegant solution ... in my opinion.

Of course, locking a scene and requiring user interaction to unlock before navigation to any other scene ... is dangerous programming. It probably is not a good idea, and depending on the complexity of your setup, will certainly cause problems somewhere down the line.

Ron
If it ain't broke ... don't fix it!

tntwebguy
New Member
New Member
Posts: 33
Joined: Wed Nov 18, 2009 9:48 am
Contact:

Re: Lock scene Idea-Done

Postby tntwebguy » Fri Jan 15, 2010 12:16 pm

I want to thank Ron and Mario for their suggestions....Please take a look at a "corkboard" scene I have completed with their generous help!

It is set for the 0019 graphics 1024 x 768 library

Attached is the Paintini.swf (placed in "swf" folder)
paintini file (which needs to be placed in the Main "Cinemar" folder
Corkboard3 background (placed in "skins" folder
Corkboard.mls scene

Make sure you "do not" have the Startup scene set to reload at all..leave blank...or you will lose writing


So here is the idea....a corkboard scene like people have in their office or kitchen...you go to this scene...write a message
like "Went to the store" and press the "lock" button....

the button hides the navigation layer, so users cannot go anywhere else....

the "unlock" button is displayed when the general navigation scenes "page.1,2 3 etc) for 0019 disappear...when pressed
it makes the navigation visible...


Whatever is written in the Paintini swf, does not save...for that to happen, you would need a server with php, to reload an image...I don't have time to write the code and set it up...and I personally don't need that..its just for a quick note, if when you don't have a pen...

Please download and enjoy...and thank you thank you thank you for a great product and community

-TNT
You do not have the required permissions to view the files attached to this post.

tntwebguy
New Member
New Member
Posts: 33
Joined: Wed Nov 18, 2009 9:48 am
Contact:

Re: Lock scene new Bug

Postby tntwebguy » Fri Jan 22, 2010 3:31 pm

I need help...I just noticed a new bug.....with the PaintButtonIni.swf

I have the PaintButtonIni.swf in the BackgroundFX layer....it was still displayed when I Navigated to some other pages...

So I added in
Macro|MLCmd|MLCommand|~{{clientname}}~setProperty|BackgroundFX~visible~false

on the scene exit.....It worked...however, if I go to another page with a .swf in the same layer..nothing shows..
particularly Music_layer_navigation_main.mls

I understand the the loop happening....but i need help with understanding MLcommands

Even if I remove the "setProperty|BackgroundFX~visible~false" , the paintButtonIni.swf is sticking around in the new scene...even though the scene options panel is not calling for it..its calling for Music_layer_navigation_main.mls.

thanks as always

-TNT

bigDvette
Expert
Expert
Posts: 718
Joined: Thu Oct 12, 2006 12:19 pm
Contact:

Re: Lock scene

Postby bigDvette » Fri Jan 22, 2010 3:35 pm

Why don't you try removing the layer instead of hiding it.

tntwebguy
New Member
New Member
Posts: 33
Joined: Wed Nov 18, 2009 9:48 am
Contact:

Re: Lock scene

Postby tntwebguy » Fri Jan 22, 2010 3:40 pm

How?
And if I remove the layer...won't the layer be gone for the whole session of ML?

-TNT

bigDvette
Expert
Expert
Posts: 718
Joined: Thu Oct 12, 2006 12:19 pm
Contact:

Re: Lock scene

Postby bigDvette » Fri Jan 22, 2010 4:30 pm

I don't have samples in front of me at the moment, but you can use loadoverlayadvance and removeoverlayadvanced or something close to that to load and unload layers.

You say you are hiding background_fx correct? You aren't hiding paintbuttonini.swf, you are hiding backgroundFx so when you go to the next scene, you aren't seeing what is in that background FX because you have hidden that layer. The layer is not the SWF, the SWF is in the layer.

I think this is what you are doing. So instead of hiding it, unload it when you want it to go away and load it when you want it to show and then when you go to other screens, if they have something in backgroundFX it will be behave as it did before.

bigDvette
Expert
Expert
Posts: 718
Joined: Thu Oct 12, 2006 12:19 pm
Contact:

Re: Lock scene

Postby bigDvette » Fri Jan 22, 2010 4:36 pm

The command would be:

MLCmd|{{clientname}}~unloadLayer|[layer number]

replace [layer number] with layer number when you are looking at the options page. I think background is 1

tntwebguy
New Member
New Member
Posts: 33
Joined: Wed Nov 18, 2009 9:48 am
Contact:

Re: Lock scene

Postby tntwebguy » Fri Jan 22, 2010 7:40 pm

Ok I tried your command exactly and it is not working
you are right... The swf is not unloading, but it is on the backgroundFX
layer which is 1..its still there...but only when I navigate to
another page with a swf in the same layer like the music nav swf
What am I doing wrong? Can I specify to unload the paintini.swf
specifically in an mlcmd?? Instead of the layer??

Thanks for the quick response

-Tnt

bigDvette
Expert
Expert
Posts: 718
Joined: Thu Oct 12, 2006 12:19 pm
Contact:

Re: Lock scene

Postby bigDvette » Fri Jan 22, 2010 9:28 pm

Are you typing the command I gave you in the option panel? You need to do this as a command with whatever method you are using to navigate away from the coarkboard.


Return to “MLServeCmd Examples”

Who is online

Users browsing this forum: No registered users and 1 guest