Page 1 of 1

Background issue - SWF

Posted: 22 May 2009, 14:50
by Inertia
Hello,

I recently purchased Imagevue and I've set up my gallery. I'm pretty familiar with some php, html and css, however my Flash is somewhat limited. I've searched the forums, searched google but unfortunately I cannot find an answer to my problem, hence my post.

In the template - Firestarter, the background is swf. I've created and using a swf background in a new template I've done. However, the swf background in Firestarter stays in place when you resize, which looks wonderful. My swf background ends up "moving" each time the window is changed and only returns back to the bottom right position on refresh.

Link so you can see:

http://enchantedcanvas.com/Gallery/#/content/1/

If you resize the broswer window, you'll see what I mean. I would love for the background to remained "fixed" like the Firestarter background does but not sure exactly what code to put.

The AS is 2.0, and I've checked to make sure that on the template config I have it set to noScale, alignment is bottom right.

The AS code I'm using is as follows:
Code
fireflays =function(maxF) {
	this.createEmptyMovieClip("fireflay_mc",this.getNextHighestDepth());
	fireflay_mc.attachMovie("fireflay", "f", fireflay_mc.getNextHighestDepth());
	no_f=1;
	
	duplicateFirefly = function(){
		fireflay_mc.f.duplicateMovieClip(["f"+no_f], no_f);
		fireflay_mc["f"+no_f]._x=Math.random()*Stage.width;
		fireflay_mc["f"+no_f]._y=Math.random()*Stage.height;
		fireflay_mc["f"+no_f]._alpha=Math.random()*100;
		fireflay_mc["f"+no_f]._rotation=Math.random()*360;
		//fireflay_mc["f"+no_f]._xscale=fireflay_mc["f"+no_f]._yscale=Math.random()*100; //scale firefly
		no_f++;
		if(no_f>maxF) clearInterval(fireflayID);
	 }
	fireflayID = setInterval(duplicateFirefly, 100);  
}

fireflays(100); 
The Flash file is "Transparent", aligned Right, position Right Bottom, and is also noScale.

It is the main "image" in the flash that doesn't stay put. I thought about adding the image via CSS, and having the swf just be the "dots", however it doesn't show on the template as I think the swf overrides it.

I hope this makes sense, and if you need anything more from me, please ask. I have searched far and wide before coming here, as it helps me learn but I've truly hit a brick wall!

Thanks so much :D

Posted: 22 May 2009, 14:59
by Inertia
after posting I posted this code in frame one of the Flash.
Code
Stage.scaleMode = "noScale";
I thought it would automatically set that on publishing, but apparently not.

:shock:

It maintains the image in position, however, with this in the flash, it doesn't allow the "dots" or the swf action to work.

Posted: 23 May 2009, 09:45
by mjau-mjau
This issue has a logical explanation. When aligning your background to the BOTTOM RIGHT, it uses the width and height of your SWF to caluclate the position. Since the width and height of your background is changing based on the dynamic contents, it won ´t be able to position your background correctly.

Why does this work with firestarter theme? Because I made sure that the dynamic effects did not exceed the bottom and right side of the background.

If you add your background to top left, I dont think this would be a problem. If you are going to place it at bottom right, you will need to take this into consideration. A workaround is to make a background vector area cover the entire area of where the dynamic effects may appear. This way, the effects will not have any effect on the movieclip width or height since it is within the static area.

Posted: 23 May 2009, 12:26
by Inertia
Hmm.. I figured it would be something simple :(

As I said, I'm relatively new to Flash, so this has been a learning experience hah.

I've fixed it now. I did separate action script for the "dots" setting a max size etc and it is all working well. Now I can finalize my site.

Thank you so much for your help!

Posted: 23 May 2009, 13:36
by gadgetologist
Really love the work of the artist you're working with.

Posted: 23 May 2009, 16:02
by Inertia
Heh.. thank you :oops:

It's me :D

I am the Artist -smiles-

Posted: 25 May 2009, 03:46
by Nick
Whoa, cool, the only thing... On the background there is girl with the wings, and its rotated vertically. Now it looks like she's been flying carelessly and hit the skyscraper accidently.

Posted: 25 May 2009, 07:35
by Inertia
LOL I suppose she does. Only that is the way I had the original image painted, with her in that position. I didn't want to deviate from the original, but now you have me thinking otherwise :D

Thanks XD