Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
Artur
Imagevue PowerPack
Posts: 510
Joined: 20 May 2011, 03:17

Re: Multi lingual

13 Jun 2011, 18:01

mabro wrote:Coming back to the same picture when changing languages is very nice too!! (... the light is not turned off then, though, but that's just a minor point)
It is fixed now, found a much easier way 8)
Code
this.onEnterFrame = function (){
	SWFAddress.text = SWFAddress.getValue();
	if (SWFAddress.text.indexOf(".jpg") == -1){
		var myTween:Tween = new Tween(black_square, "_alpha", Strong.easeOut, black_square._alpha, 0, 1, true);
	} else{
		var myTween:Tween = new Tween(black_square, "_alpha", Strong.easeOut, black_square._alpha, 80, 1, true);
	}
}
Thank You.
 
User avatar
Martin
Experienced
Posts: 651
Joined: 30 Jan 2011, 23:24

Re: Multi lingual

13 Jun 2011, 23:19

philip100 wrote:It is fixed now, found a much easier way 8)
Yes, the light stays off now. Great!
I'll be checking your site with interest to see you next creative changes :)

b.t.w. you should put a link to your site in your signature... I'm sure more people are interested to see your changes..
 
grimurnet
Experienced
Posts: 360
Joined: 17 Dec 2010, 04:50

Re: Multi lingual

16 Jun 2011, 11:46

This is cool, but the only problem is that it slows down imagevue animation. So everything is very slow, hovering over menu and imagebuttons. Other than that this is awsome :-) but only slightly, it maybe that the gallery runs more heavier and you notice only when using a computer with low ram or cpu speed.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: Multi lingual

17 Jun 2011, 00:56

That is a very inefficient script running there, and as grimurnet mentions, it certainly has the capacity to increase CPU usage drastically. as far as I can see, you have an event below that triggers 60 times per second, and then for each of these times, you are also triggering a Tween event. If you want to optimize this, first of all can you not execute this onSWFAddress change instead? Why enterframe? Second, if you for some reason must use enterFrame (although this should be changed to setInterval instead), then must you trigger a tween event each time? As far as I see it, this script is triggering a tween 60 times a second even as you visitor is simply viewing an image ... it should only trigger the the tween if the swfaddress has actually CHANGED from what it was last time the event checked.
Code
this.onEnterFrame = function (){
	SWFAddress.text = SWFAddress.getValue();
	if (SWFAddress.text.indexOf(".jpg") == -1){
		var myTween:Tween = new Tween(black_square, "_alpha", Strong.easeOut, black_square._alpha, 0, 1, true);
	} else{
		var myTween:Tween = new Tween(black_square, "_alpha", Strong.easeOut, black_square._alpha, 80, 1, true);
	}
}
 
User avatar
Artur
Imagevue PowerPack
Posts: 510
Joined: 20 May 2011, 03:17

Re: Multi lingual

17 Jun 2011, 09:57

Thanks for sugestions.

Of course, my friends notice me that the site slowed down (for me is ok, but I have powerful computer), and I suspected that it has something to do with my modifications (especially onEnterFrame function)
mjau-mjau wrote: If you want to optimize this, first of all can you not execute this onSWFAddress change instead? Why enterframe?
My knowledge of AS2 is so small that I could not find a better solution for this. onSWFAddress.change works well if the link to an image is not a direct link - then just "onSWFAddress change" function not work... :oops:
mjau-mjau wrote:As far as I see it, this script is triggering a tween 60 times a second even as you visitor is simply viewing an image ... it should only trigger the the tween if the swfaddress has actually CHANGED from what it was last time the event checked.
I will try to look into this

--------------------------
Thank You,
Artur.
Last edited by Artur on 17 Jun 2011, 15:27, edited 1 time in total.
 
User avatar
Artur
Imagevue PowerPack
Posts: 510
Joined: 20 May 2011, 03:17

Re: Multi lingual

17 Jun 2011, 13:16

Ok, I think it should be a bit better.

This is the start code (for linking directly to image):
Code
My_interval = setInterval(check_URL, 2000);

function check_URL(){
	SWFAddress.getValue();
	if (SWFAddress.getValue().indexOf(".jpg") == -1){
		trace ("none");
	} else{
		var myTween:Tween = new Tween(black_square, "_alpha", Strong.easeOut, black_square._alpha, 80, 1, true);
		clearInterval (My_interval);
	}
}
and after that, animations are based on "SWFAddress.onChange" function.
Code
SWFAddress.onChange = function(){
	SWFAddress.getValue();
	if (SWFAddress.getValue().indexOf(".jpg") == -1){
		var myTween:Tween = new Tween(black_square, "_alpha", Strong.easeOut, black_square._alpha, 0, 1, true);
	} else{
		var myTween:Tween = new Tween(black_square, "_alpha", Strong.easeOut, black_square._alpha, 80, 1, true);
	}
}
I know, it's not perfect code, but should works much better.

--------------------------
Thank You,
Artur.
Last edited by Artur on 17 Jun 2011, 14:52, edited 1 time in total.
 
User avatar
Martin
Experienced
Posts: 651
Joined: 30 Jan 2011, 23:24

Re: Multi lingual

17 Jun 2011, 13:40

philip100 wrote:I know, it's not perfect code, but should works much better.
Yes, indeed... the thumnails and images do load a lot quicker now.
 
User avatar
Artur
Imagevue PowerPack
Posts: 510
Joined: 20 May 2011, 03:17

Re: Multi lingual

17 Jun 2011, 14:44

Martin wrote:Yes, indeed... the thumnails and images do load a lot quicker now.
Thank You Martin, You always makes me proud of my work on site :)

Now should be a bit better - tween's will only execute when detect taht light is on or off.
Code
SWFAddress.onChange = function(){
	SWFAddress.getValue();
	if (SWFAddress.getValue().indexOf(".jpg") == -1){
		Light_On();
	} else{
		Light_Off();
	}
}

function Light_Off(){
	if (black_square._alpha == 80){
		trace ("done");
	} else{
		var myTween:Tween = new Tween(black_square, "_alpha", Strong.easeOut, black_square._alpha, 80, 1, true);
	}
}

function Light_On(){
	if (black_square._alpha == 0){
		trace ("done");
	} else{
		var myTween:Tween = new Tween(black_square, "_alpha", Strong.easeOut, black_square._alpha, 0, 1, true);
	}
}
In the example which I wrote earlier, tween's was executed always when switching next/previous image.

What do You think about this code, Karl?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: Multi lingual

18 Jun 2011, 02:44

philip100 wrote:What do You think about this code, Karl?
Yes, this looks perfect to me ... The script only executes if there is a change in the SWFAddress, which basically fixes everything. In addition, you only execute the tween if the gallery mode is in state of change, which is further correct optimizing ...

Just for the sake of coding perfection, I would optimize your codes like this:
Code
function Light_Off(){
   if (black_square._alpha != 80){
      var myTween:Tween = new Tween(black_square, "_alpha", Strong.easeOut, black_square._alpha, 80, 1, true);
   }
}

function Light_On(){
   if (black_square._alpha != 0){
      var myTween:Tween = new Tween(black_square, "_alpha", Strong.easeOut, black_square._alpha, 0, 1, true);
   }
}
 
User avatar
Artur
Imagevue PowerPack
Posts: 510
Joined: 20 May 2011, 03:17

Re: Multi lingual

19 Jun 2011, 15:06

Thank You very much for help. And, Of course, your version is perfect :wink:
 
User avatar
Artur
Imagevue PowerPack
Posts: 510
Joined: 20 May 2011, 03:17

Re: Multi lingual

19 Jun 2011, 21:06

"Comercial" version of Buttons Bar is ready. :)
No coding needed. Simply editable from .txt file:
Code
"language1="
"language2="
"flag_image1="
"flag_image2="
Everything you need is inside :wink:
Button_Bar.zip
(12.78 KiB) Downloaded 364 times
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: Multi lingual

19 Jun 2011, 23:12

Nice1 ... You are setting this as a background I assume?
 
grimurnet
Experienced
Posts: 360
Joined: 17 Dec 2010, 04:50

Re: Multi lingual

20 Jun 2011, 10:43

Now it is working much smoother, thanks a lot :-) I'm really liking this feature. It draws the attention to the image, it's awsome
 
grimurnet
Experienced
Posts: 360
Joined: 17 Dec 2010, 04:50

Re: Multi lingual

20 Jun 2011, 10:56

I was wondering is it not possible to link ?language=icelandic to current page, rather than the startpage?
 
User avatar
Artur
Imagevue PowerPack
Posts: 510
Joined: 20 May 2011, 03:17

Re: Multi lingual

20 Jun 2011, 14:13

mjau-mjau wrote:Nice1 ... You are setting this as a background I assume?
Thank You.
Yes, that's right, Background with "TR" aligment (so as not to infect audio-player).
Everything is explained in text file in attachment :wink:
grimurnet wrote:Now it is working much smoother, thanks a lot :-) I'm really liking this feature. It draws the attention to the image, it's awsome
You're welcome, I'm glad You like it. (I see, you miss buttons somewhere?) :)
grimurnet wrote:I was wondering is it not possible to link ?language=icelandic to current page, rather than the startpage?
You speak about my module?
Last edited by Artur on 20 Jun 2011, 14:29, edited 3 times in total.