You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Tuur

Sage

  • "Tuur" started this thread

Posts: 3,191

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

1

Thursday, September 30th 2010, 10:47am

as3 question

Hi,

when i make a fullscreen button that flips automaticaly, when the screen changes or is being changed by another action, i use this code:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// FULLSCREEN
	
this.btn_fullscreen.addEventListener(MouseEvent.CLICK, Fullscreen);

this.btn_fullscreenclose.addEventListener(MouseEvent.CLICK, Fullscreen);

addEventListener(Event.ADDED_TO_STAGE, init);             
function init(e:Event):void
{
	//je kan pas naar stage events luisteren, nadat het toegevoegd is aan de stage. Vandaar dat je even moet
	//wachten op de ADDED_TO_STAGE event.
	stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullscreen_event);
}

function Fullscreen(evt:MouseEvent) 
{
	switch (evt.type) 
	{
			
		case MouseEvent.CLICK :	
			if (stage.displayState == StageDisplayState.FULL_SCREEN)
			{
				stage.displayState = StageDisplayState.NORMAL;
				this.btn_fullscreen.visible = true;
				this.btn_fullscreenclose.visible = false;
			}
			else
			{
				stage.displayState = StageDisplayState.FULL_SCREEN;
				this.btn_fullscreen.visible = false;
				this.btn_fullscreenclose.visible = true;
			}
		break;
	}
}
function fullscreen_event (event:FullScreenEvent):void
{
	if (event.fullScreen == true)
	{
		// now being in fullscreen mode
		this.btn_fullscreen.visible = false;
		this.btn_fullscreenclose.visible = true;
	}
	else
	{
		// back to window mode
		this.btn_fullscreen.visible = true;
		this.btn_fullscreenclose.visible = false;
	}
}



Now i want that for the gallery button aswell, so that is being traced if the gallery is visible and when not then change/flip the button...
So how to do that... re-write this..???

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Gallery

this.btn_gallery.addEventListener(MouseEvent.CLICK, ShowGallery);
this.btn_galleryclose.addEventListener(MouseEvent.CLICK, ShowGallery);



var ShowGalleryToggled:Boolean = false; //variable om te kijken of autorotate aangezet is.

function ShowGallery(evt:MouseEvent) 
{
	switch (evt.type) 
	{
		
			
		case MouseEvent.CLICK :	
			if(!ShowGalleryToggled)
			{
				krpano.call("action(showgallery)");
				this.btn_galleryclose.visible = true;
				this.btn_gallery.visible = false;
				ShowGalleryToggled = true;
			}
			else
			{
				krpano.call("action(hidegallery)");
				this.btn_galleryclose.visible = false;
				this.btn_gallery.visible = true;
				ShowGalleryToggled = false;
				
				
				
				
			}
		break;
	}
}


Thanx a lot!!

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Tuur

Sage

  • "Tuur" started this thread

Posts: 3,191

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

2

Thursday, September 30th 2010, 1:44pm

maybe another sollution..

is it possible to make a flash symbol (button) visible false from your xml code??
*confused* *confused*

Cheers

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

3

Friday, October 1st 2010, 11:04pm

Does the button have krpano interface? If it does, you can add any function to the xml.

When registering:

plugin.makeinvisible = makeInvisible;

And then:

function makeInvisible() { visible = false; }

And finally in the xml

<event somethingsomething="plugin[myplugin].makeinvisible();" />

?

I don't know if you can access the property directly or not, and judging by how long you've been around I doubt the solution is as simple as the one I came up with, since you probably know more than I do, but if so please clarify the question ^^

Similar threads