Difference between revisions of "SWFAddress"

From Wikicliki
Jump to: navigation, search
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
SWFAddress allows deep-linking. Should be used with [[SWFObject]] at the same time.
 
SWFAddress allows deep-linking. Should be used with [[SWFObject]] at the same time.
  
insert this after swfobject:
+
HTML - insert this after swfobject:
 
<pre><script type="text/javascript" src="swfobject/swfobject.js"></script>   
 
<pre><script type="text/javascript" src="swfobject/swfobject.js"></script>   
 
<script type="text/javascript" src="swfaddress/swfaddress.js"></script></pre>
 
<script type="text/javascript" src="swfaddress/swfaddress.js"></script></pre>
  
write your navigational logic:
+
FLASH - write your navigational logic:
 
<pre>SWFAddress.onChange = function() {   
 
<pre>SWFAddress.onChange = function() {   
    // Your code goes here.
+
      var navigation = new Object();
 
+
      navigation.home = {frame: 1, title: "Welcome"};
 +
      navigation.about = {frame: 10, title: "About Us"};
 +
      navigation.contact = {frame: 20, title: "Contact Us"};
  
 +
      var value = SWFAddress.getValue();
 +
      website_mc.gotoAndStop(navigation[value].frame);
 +
      SWFAddress.setTitle(navigation[value].title);
 
}</pre>   
 
}</pre>   
  
set value on buttons which lead to their own links:
+
FLASH - set value on buttons which lead to their own links:
 
<pre>this.onRelease = function() {   
 
<pre>this.onRelease = function() {   
 
     SWFAddress.setValue('/portfolio/');   
 
     SWFAddress.setValue('/portfolio/');   
 
}</pre>   
 
}</pre>   
  
 
+
HTML - your html links in your text boxes can be like this:
your html links in your text boxes can be like this:
 
 
<pre><a href="asfunction:SWFAddress.setValue,/portfolio/">Go to Portfolio</a></pre>
 
<pre><a href="asfunction:SWFAddress.setValue,/portfolio/">Go to Portfolio</a></pre>
  
Line 28: Line 32:
 
*[http://www.adobe.com/devnet/flash/articles/deep_linking.html Adobe Developer Center on Deep Linking methods] - another method offered for Deeplinking using the Hash
 
*[http://www.adobe.com/devnet/flash/articles/deep_linking.html Adobe Developer Center on Deep Linking methods] - another method offered for Deeplinking using the Hash
 
*[http://www.asual.com/swfaddress/ SWFAddress Website]
 
*[http://www.asual.com/swfaddress/ SWFAddress Website]
 +
[[Category:Programming]]

Latest revision as of 03:49, 1 June 2009

SWFAddress allows deep-linking. Should be used with SWFObject at the same time.

HTML - insert this after swfobject:

<script type="text/javascript" src="swfobject/swfobject.js"></script>  
<script type="text/javascript" src="swfaddress/swfaddress.js"></script>

FLASH - write your navigational logic:

SWFAddress.onChange = function() {  
      var navigation = new Object();
      navigation.home = {frame: 1, title: "Welcome"};
      navigation.about = {frame: 10, title: "About Us"};
      navigation.contact = {frame: 20, title: "Contact Us"};

      var value = SWFAddress.getValue();
      website_mc.gotoAndStop(navigation[value].frame);
      SWFAddress.setTitle(navigation[value].title);
}

FLASH - set value on buttons which lead to their own links:

this.onRelease = function() {  
    SWFAddress.setValue('/portfolio/');  
}

HTML - your html links in your text boxes can be like this:

<a href="asfunction:SWFAddress.setValue,/portfolio/">Go to Portfolio</a>

See Also