Jump to content


Photo
- - - - -

TIP: Bringing it all together


  • Please log in to reply
12 replies to this topic

#1 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 06 November 2008 - 05:43 AM

Hi,

Just heard yesterday that I got the full time job I had applied for,
And I start Monday morning!!

So, in celebration of that and in the spirit of learning and sharing that which I have learned,
I have decided to offer v12 of FlawlessDog.com as a download for this SWiSHMax community.

Iíve been asked several times how I did the stage management, scroll bar, and all the rest of it.
Seems a picture is worth a thousand words, so here we go.

This template is NOT a component, and is only for those that really like to get their hands dirty, and just jump right into the ActionScript.

Iíve tried to leave as many notes as I could within the ActionScript, so read on.

I've changed the text, and killed the links.
Got rid of all but one gallery pic for the sake of the zip file size.

Enjoy!

Site Features
Ok, the goal here is to take what I have and work it all into a useable, attractive website. I personally would like to go for a clean look, and still create a good content layout that utilizes the white space the best. After 20 years in the offset printing industry as a press operator, I've seen a lot of page layouts in print and it seems that I should try to base this website layout on that knowledge, even if it is a simple page layout.

As with several of my past projects, Carmex Lip Balm, and my own v11_1 of FlawlessDog.com, this site features the SWFAddress. I really do like that bit of script, as it feeds right into my interest in a good flash navigation system. I've had a bit of practice using this script, and I think I have improved somewhat. You can find some of the work I done with SWFAddress, at the SWiSHZone forums.

I have learned to create the pages a bit more dynamically, so I am no longer using the timeline based system in the beginner examples that can be found on Asual's samples page. In this example, the entire nav system structure is created and controlled from the menu xml.

Also, I am playing around with stage management to a greater extent in this version of my website. This also includes the use of a scrollbar to handle content overflow. The scrollbar should work pretty much like any other; scroll wheel activated, up and down keyboard arrows as well as the page up, page down keys which will scroll the window a bit faster than the arrow keys. I am using a new formula to size the scrollbar itself so that is a more accurate ratio to the content height.


Oct. 30, 2008:
Well, I've done a few new things yesterday, and today. I took out all the old easing scripts; the plain penner.as and all the SWiSHMAx2 Math.approch stuff. Replaced it all with the MC Tween2 easing scripts. Does seem to work better, now. There does still seem to be a couple bugs left when I re-size the screen, tho not too bad.

Nice thing is there are fewer onEnterFrames running at any given time, and that sure seems to have helped the cpu usage issues
more....


Oct. 28, 2008:
Put together a new xml gallery for use on this site. Wanted to fill up the page a bit on this one, so used a grid for the thumbnails. Also, as the pics were too big to fit in the page, I placed them over the page. Used a block out to hide the links under the full sized pic. It's a bit more "manual" than I would have otherwise liked. Gotta click the pic to close it, before viewing another, but still not too awful bad, huh?

Attached Files


FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#2 David Petley

David Petley

    Advanced Member

  • Admin
  • PipPipPip
  • 7111 posts
  • Gender:Male

Posted 06 November 2008 - 05:55 AM

Congratulations on the job Larry :) good news in such times as these.

I will read the rest of your post in-depth later, and look forward to diving into FlawlessDog V12 thanks to your gracious offer.

david

http://blog.swishzone.com/ ...for cool tutorials, samples and new components


#3 pedromau

pedromau

    Advanced Member

  • Members
  • PipPipPip
  • 411 posts

Posted 06 November 2008 - 09:44 AM

In 3 words (and a half...lol...)

YOU'RE THA MAN!!!

This will take some time to get involved into all the actionscript!!
Will be my precious!!!
lol

There's a lot to learn there! thanks FD!!! really

#4 pedromau

pedromau

    Advanced Member

  • Members
  • PipPipPip
  • 411 posts

Posted 06 November 2008 - 09:49 AM

Just noticed that my cpu is around 60%!
In your site that doesn't happens!
What's wrong?

#5 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 06 November 2008 - 10:07 AM

Just noticed that my cpu is around 60%!
In your site that doesn't happens!
What's wrong?


I don't know...That shouldn't be.

The index.swi is the very same one I used in my site, as well as the includes files.
The only difference at all, is the content in the index.html and images folder.
FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#6 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 06 November 2008 - 10:23 AM

Just noticed that my cpu is around 60%!
In your site that doesn't happens!
What's wrong?


I just checked it on my machine, and it jumps to 75 when window is first opened,
and drops to below 9 after page transistion is completed.

It seems fine on my end...
FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#7 pedromau

pedromau

    Advanced Member

  • Members
  • PipPipPip
  • 411 posts

Posted 06 November 2008 - 10:26 AM

weird... because in mine 50% is the minimum!
using IE8, in vista

#8 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 06 November 2008 - 10:30 AM

weird... because in mine 50% is the minimum!
using IE8, in vista


I am using IE7 on XP-pro
Just rried it again, and only spiked to 50, then down to 5.
Page changes once window is open here, are all under 30
then drops to 5 again.

Again, seems fine here.
FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#9 David Petley

David Petley

    Advanced Member

  • Admin
  • PipPipPip
  • 7111 posts
  • Gender:Male

Posted 06 November 2008 - 10:49 AM

processor sizes, processor loads, background processes, available memory...lots of things can affect performance on different computers.

davidp

http://blog.swishzone.com/ ...for cool tutorials, samples and new components


#10 haakoo

haakoo

    Advanced Member

  • Members
  • PipPipPip
  • 421 posts

Posted 06 November 2008 - 06:43 PM

Hi,

Congratulations on the job.
No problems here, onload up to 62% then down to 2%

@Pedro,

Here's a tool which checks every process on your machine http://technet.micro...s/bb896653.aspx
you can see what resources are used.
you can check on line what every process is for.

This way you might find a program that's causing your troubles.
seems you have some issues,as you mentioned your CPU resource drain before

Hans
Hans

#11 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 08 November 2008 - 01:33 AM

Thanks, and glad you like it.
I've learned a lot around these parts
and other forums, so thought it would be
a good way to give something back
to the SWiSHMax community.

The only thing I ask, is that if anyone can improve on what
I have started here, that they would share as I have done. :)
FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#12 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 17 November 2008 - 05:22 AM

Got an update:
This fixes the bug in the email form, and the clumsy solution I had in there for the "Selection.setFocus" issue for the input fields of the contact form. It used to work, when imported into the text field like it is now, but at one of the flash9 updates, it no longer worked. I should have thought of this solution before, it was so obvious. Sorry 'bout that.

Anyway, as follows:
The contact form itself is now a library item in the index.swi and is no longer in the contact.swi.
The new contact.swi now uses attachMovie to call the actual contact form from the index.swf, and place it right over itself, just outside of the main text area( _root.mainBody.pageHolder.myArea.getNextHighestDepth() ).
Deletes itself when the contact.swf is no longer in the page.

Zipfile contains an updated index.swi, and contact.swi
You'll need to export your swf's from your own v12 work folder.
All other files in the original zipfile haven't changed at this point.

Attached Files


FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D

#13 FlawlessDog

FlawlessDog

    Advanced Member

  • Members
  • PipPipPip
  • 516 posts
  • Gender:Male
  • Location:We're not in Wisconsin anymore, Toto.
  • Interests:Doin' 3D in Swish

Posted 22 December 2008 - 09:11 AM

Ok, I have this update for the v12 template. Of course itís one of those updates that should have been in there the first time, but you know how it goes...sorry Ďbout that, but better late than never. Youíll see what I mean as I continue typing.

Anyway, this update puts the footer on each page...you know, that text menu at the bottom of each page.
Got it all into one special set of xml tags, as it should have been from the start.
Wasnít too hard to do. Below is attached one zip file with the full site, updates and all.
(FlawlessDogv12_12_20_2008_FullUpdate_Template.zip )
And one zip file with just the updated files:
(FlawlessDogv12_12_20_2008_Update_Template.zip )

index.html
index.swi
index.swf
includes/myTextField.sm2

The index.html changes:

Remove the text menu from the bottom of each page. Be sure you remove the same amount of ďfooterĒ from each page. In the case of this template as written, I chose to take this out:

<br />
	<br />
	<br />
	<br />
	<p class="copy" align="center"><a href="asFunction:_root.mypageChange,/">Home</a> | <a href="asFunction:_root.mypageChange,/Blog/">Blog</a> | <a href="asFunction:_root.mypageChange,/Work/">Work</a> | <a href="asFunction:_root.mypageChange,/School/">School</a> | <a href="asFunction:_root.mypageChange,/School/Vicom-1/">Vicom 1</a> | <a href="asFunction:_root.mypageChange,/School/Vicom-2/">Vicom 2</a> | <a href="asFunction:_root.mypageChange,/School/Photo-Gallery/">Photo Gallery</a> | <a href="asFunction:_root.mypageChange,/School/Written-Works/">Written Works</a> | <a href="asFunction:_root.mypageChange,/Archive/">Archive</a> | <a href="asFunction:_root.mypageChange,/Archive/Templates/">Templates</a> | <a href="asFunction:_root.mypageChange,/Archive/SWiSMax-Projects/">SWiSMax Projects</a> | <a href="asFunction:_root.mypageChange,/Archive/Personal-Sites/">Personal Sites</a> | <a href="asFunction:_root.mypageChange,/Contact/">Contact</a></p>
	<br />
	<p class="copy" align="center">© Copyright Your Name, 2008</p>
	<br />
	<br />

Save one, and cut it so thereís a copy in your clipboard.

Then I wrapped my footer clip, in some new xml tags, so it looks like this right above the <home> tag:

<!-- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
  <textMenu>
	<br />
	<br />
	<br />
	<br />
	<p class="copy" align="center"><a href="asFunction:_root.mypageChange,/">Home</a> | <a href="asFunction:_root.mypageChange,/Blog/">Blog</a> | <a href="asFunction:_root.mypageChange,/Work/">Work</a> | <a href="asFunction:_root.mypageChange,/School/">School</a> | <a href="asFunction:_root.mypageChange,/School/Vicom-1/">Vicom 1</a> | <a href="asFunction:_root.mypageChange,/School/Vicom-2/">Vicom 2</a> | <a href="asFunction:_root.mypageChange,/School/Photo-Gallery/">Photo Gallery</a> | <a href="asFunction:_root.mypageChange,/School/Written-Works/">Written Works</a> | <a href="asFunction:_root.mypageChange,/Archive/">Archive</a> | <a href="asFunction:_root.mypageChange,/Archive/Templates/">Templates</a> | <a href="asFunction:_root.mypageChange,/Archive/SWiSMax-Projects/">SWiSMax Projects</a> | <a href="asFunction:_root.mypageChange,/Archive/Personal-Sites/">Personal Sites</a> | <a href="asFunction:_root.mypageChange,/Contact/">Contact</a></p>
	<br />
	<p class="copy" align="center">© Copyright Your Name, 2008</p>
	<br />
	<br />
  </textMenu>
  <!-- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->

ok, that takes care of the index.html. Save and close. Now open the file in your favorite text editor: includes/myTextField.sm2

Go to line 78, so we can add a Boolean to the getFile function: isBottom:Boolean
It should look like this now:

MovieClip.prototype.getFile=function(myBtag:String,url:String,obj:Object,isBottom:Boolean):void{

ĎK, down to line 96.
Looking for the line:

str = str.getTag(myBtag);

Replace that line with the following:

if(isBottom){
							str = str.getTag(myBtag) + str.getTag("textMenu");
						}else{
							str = str.getTag(myBtag);
						}

Now the whole getFile function should look like this:

MovieClip.prototype.getFile=function(myBtag:String,url:String,obj:Object,isBottom:Boolean):void{
		if(this.isScrollable||this.makeScrollable()) {
			this.gsb1.curUrl=url;
			this.gsb1.curObj=obj;
			if(url!=undefined){
				this.gsb1.srcURL=url;
				this.gsb1.hrs=new Object();
				this.gsb1.fileloader=new LoadVars();
				this.gsb1.fileloader.self=this.gsb1;
				this.gsb1.fileloader.onData=function(str:String):void{
					if(str.length){
						if(str.indexOf("\r")>-1)str=str.split("\r").join("");
						this.self.styleSheet = new TextField.StyleSheet();
						this.self.config.menu = _root.menu;
						s = str.getTag("styles");
						if(s.length){
							if(!this.self.styleSheet.parseCSS(s)){if(deBug)trace("ERROR: CSS Parse failure.\n"+styles);}
						}else if(deBug)trace("No styles data.");
						if(isBottom){
							str = str.getTag(myBtag) + str.getTag("textMenu");
						}else{
							str = str.getTag(myBtag);
						}
						if(str.length)str=this.self.processSpecialTags(str);
						else if(deBug)trace("No myBody data.");
					}else{
						str = "ERROR: File load failed.";
						trip();
						if(deBug)trace(str);
					}
					this.self.setText(str);
					delete this.self.fileloader;
				};
				if(obj instanceof Object){
					this.gsb1.filePostVars=obj;
					for(var p in obj)this.gsb1.fileloader[p]=this.gsb1.filePostVars[p];
					this.gsb1.fileloader.sendAndLoad(url,this.gsb1.fileloader,"POST");
				} else this.gsb1.fileloader.load(url);
			}
		}
	};

Save and close.
That Boolean gives us a way to shut it off, so we can have more than one text field, and not show that menu in the ones we don't want it to display in.
Cool, huh?

Now to the index.swi/swf
Two small changes here, and weíre almost done.

Open index.swi.
Look for:
Scene_1
Line 82.
Change this:

this.mainBody.pageHolder.myArea.myTxt.getFile(_root.pageID,"./index.html");

to this:

this.mainBody.pageHolder.myArea.myTxt.getFile(_root.pageID,"./index.html",undefined,true);

Donít worry Ďbout the undefined bit. I could change that, but I got lazy...

Now find this:
Scene_1
mainBody/pageHolder/mySideBanner/myTxt

In the script window change the script from this:

this.getFile("sidepanel","./index.html");

to this:

this.getFile("sidepanel","./index.html",undefined,false);

Save, and do a Ctrl+t to make a new swf, or how ever you export your new swf.

That should do it....
If it doesnít...
well....
....it worked just now when I tried it ;)

Attached Files


FlawlessDog.com - 'previously eggs-in-Wisconsin'
My top threads to watch: | (Check for multiple/updated attachments in each thread)
Bringing it all together | MC_Tween2 for SM2 | experimental xml gallery | 3d Spiral Stair Case
Component Pack | SWFAddress v2.0/SWFObject v1.5 | Practice script - (chat app) | 3D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users