SWFAddress Design Template 2.0
With the release of SWFAddress 2.0 I figured now would be a good time to update my Flash design template to version two. The update includes the new SWFAddress 2.0 and SWFObject 2.0 as well as updated HTML embedding. The code has been cleaned up a bit the AS3 version loads a Flex app (blog reader) and includes the some AS3 font embedding just for fun.
Here’s a more detailed explanation.
UPDATE 1.13.09 – includes the new SWFAddress 2.2 and SWFObject 2.0 code
Download for AS2
View example
Download for AS3
View example
28 Comments so far
Leave a reply
Nice work yo!
This is great… i’m a designer and i’ve spent 10 years trying to have a great simple way to wrap cool graphics around stuff. Your source files are a deep_hook_up
thanks man..
John
thanks John, your welcome! i’m glad to hear you find it useful. one of these days i’m going to finish writing up a little explanation on how it works, how to use it and make changes, etc. … and eventually a tutorial on how to do dynamic deep linking with clean URLs using this same template.
Good resource, it should be an eyeopener.
I tried compiling your As3 version and error says;
1046: Type was not found or was not a compile-time constant: SWFAddressEvent.
this is line 50
function handleSWFAddress(e:SWFAddressEvent):void {
the As2 version works fine
Thanks!
I too received the 1046 error. How do you fix it?
Thanks
I received the 1046 error, as well. What does this mean and how can I fix it.
thanks
i’m looking into this… it seems to only be happening with Windows machines as far as i can tell, which is strange….
I think your AS2 example is a AS1 one. Cause the class concept is ignored. Just import as files is not AS2.
Plus you are using the SWFAddress AS1 _global function…
AS3 version works fine ^^ nice job.
Justin,
I receive the 1046 error on my MAC machine, not windows. I’m compiling the code in Flash CS3 version 9. Hope this helps.
@wes : found the issue with the AS3 – 1046 error… the classpath was pointing to a directory on my machine, when it needs to point to “./src”. I’ve uploaded a new version that fixes this as well fix to an issue with the Garbage Collector and the TransistionManager that was causing the transition to stop before it was actually done. Apparently it’s not good to have nested functions like I had previously done in AS2.
Justin,
You fixed the 1046 error. Excellent work and thank you again for sharing a great template.
Cheers,
Wes
@Pioup : yea, I’m using ‘inline’ code for these templates … just for simplicity’s sake. AS1 and AS2 are both compiled into the same bytecode when published, so using one or the other doesn’t really matter. _global is available in AS1/AS2 .. but not in AS3. IMHO i think using all classes for something like this is a bit overkill … especially with Flash designers who have little OOP experience. The complexity of keeping everything encapsulated and extensible is just not worth it when you’ve got deadlines and need something done yesterday. When building a site using all classes, I’d definitely want to start with a framework like ARP (AS2) or Cairngorm (AS3) or one of the many others out there.
I have a question, How do you create a new page? I tried duplicating anything that said about for example, but I can’t get the page to come up.
I am a bit confused by the class thing. I can’t seem to find where you connect .as files in the com/../../../ folders to the buttons.
is there a quick way to add new pages?
hey john
i have an explanation of this template in the works, but I just haven’t had the time to finish it. one of these days i’ll get there… in the mean time maybe this will help.
for the buttons, i use classes because i don’t like to have the code spread out on the button instances in the movieclips i use for navigation. if i have to make a change to the button actions, i can just change the one class file and not have to worry about every keyframe the button is on. the classes are attached to the buttons by using the Linkage property, which can be accessed by right-clicking on the button symbol in the library and selecting “Linkage…” You’ll see the classpath entered there.
for a page called ‘newpage’, you’d could do the following:
1. create a new button and associated class (or duplicate existing class) and change the swfaddress link : SWFAddress.setValue(‘/newpage/’); Set the Linkage for the new button.
2. in the ApplicationForm.fla file, double click the ApplicationForm mc and create a new layer (name it ‘newpage’ for consistency) and on this layer create a new movieclip with an instance name of ‘newpage’. Put your newpage content here, (actionscript for this page could be kept in an include file like the example, or directly within this movieclip.)
3. in the ApplicationForm.as file (includes folder) you’ll need to add a line to the ‘hideSections()” function so that your new page gets hidden when there is a page change: “newpage.visible = false”;
save and export…. that should do it!
Linkage! haha.. I looked for that for ever. When I first replied up there at the top. I came back to it because I was so inspired to the clean code.
Thanks for sharing… and teaching.
great work!
noticed one thing: on Safari Version 3.0.4 (523.12.2) the AS3 Example shows up as a blank white page. i looked at Window > Activity and it said:
Flash Player Installation:
…”http://www.chakramedia.com/examples/SWFAddressDesignTemplate/AS3/swfobject/expressinstall.swf” ” “not found”
What if I want to deeplink external swfs how could this be done?
Thanks!
Awesome examples, thanks for sharing. Best regards
Great example indeed. Do you still have a template explanation in the works, Justin? Would be great.
Thanks!
A massive “thank you” all the way from Cape Town, South africa!
Many thanx, just excellent!
Hi,
Is there a LITE version to this? For programming beginners (aka designers)? I need a version I can easily implement into my websites.
Anony (and Pieter) … thanks for reminding me I need to get that explanation/tutorial done… i’ll keep working on it
To that designer up there- girl, good luck! Post for a developer on craiglist or sumpn.
I’m currently looking any examle like this one for Flex
Anyone had seen smth like that??
Looking forward for the tutorial.
Hi,it’s great and useful but i cannot open the fla’s files in flash cs4 (it seems strange) the error is “the docfile has been corrupted”, it happens also with as2 files
Thank you
All people deserve very good life and loan or just term loan would make it better. Just because freedom bases on money state.