Skip to main content
Inspiring
December 6, 2012
Question

SWFaddress and data driven site

  • December 6, 2012
  • 1 reply
  • 1643 views

Anybody have experience using SWFAddress? I've seen the tutorials for creating a very basic site with a Portfolio, Contact, etc. But I need to take this farther.

I'm making a site for some web forum events. It has a tab for the various weeks of upcoming events. Then after the week is over, the recording of the events for that week move over to the Archive tab. There is also an Exhibit hall of various "vendors." For all three tabs there is a data grid or combolist that lets the user select various groups to view — they can see a stub, truncated preview. They can click on those stubs to open up more information.

So I'm trying to figure out how to handle the URLs and the parameters that will allow the users to bookmark and/or share specific events, weeks, exhibitors, etc.

I'm thinking of setting up my urls something like:

MySite.org/page.html#/home

MySite.org/page.html#/events?forum=dateofforum&sort=date

MySite.org/page.html#/events?forum=dateofforum&sort=date&event=eventID

and so on. One of the tricks is that if the user bookmarks a specific event before it happens, but then wants to come back to it after it has happend I need to change

MySite.org/page.html#/events?forum=somePastDate&event=eventID

to

MySite.org/page.html#archive?forum=somePastDate&event=eventID

I guess that shouldn't be too hard.

Does anybody have experience doing these kind of things? Any tips or tricks?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 6, 2012

just about the only time i use more than one frame on the main timeline is when using swfaddress.  i usually create two frames for each "page" - eg, an enter_page1 and and exit_page1. 

the exit page frame cleans up whatever needs to be done to gracefully exit a frame before moving to the next frame and that exist frame does not get passed to swfaddress.  the enter frame does get passed to swfaddress.

i create functions to handle the swfaddress stuff:

swfaddress.SWFAddress.onChange = function() {

    var address_value = swfaddress.SWFAddress.getValue().split("/").join("");

    //trace("ONCHANGE-currentFrameS:"+currentFrameS+"::  address_value:"+address_value+"::  nextFrameS:"+nextFrameS);

    if(currentFrameS=="rundown" && nextFrameS=="rundown"){

        // stop problems when back button after enter site clicked.

        return;

    }

    if(currentFrameS!=undefined && currentFrameS!=""){

        tl.gotoAndStop("exit_"+currentFrameS);

    } else {

        //trace("GOTO "+"enter_"+address_value);

        currentFrameS = address_value;

        tl.gotoAndStop("enter_"+address_value);

    }

    if(currentFrameS == nextFrameS){

        nextFrameS = address_value;

    }

};

function setNextFrameF(s:String){

    //trace("******** setNextFrameF, nextFrameS:"+s);

    ExternalInterface.call("trackF",s);

    nextFrameS = s;

    swfaddress.SWFAddress.setValue(s);

}

function nextFrameF(){

    //trace("nextFrameF-nextFrameS:"+nextFrameS)

    currentFrameS = nextFrameS;

    tl.gotoAndStop("enter_"+nextFrameS);

}

RothrockAuthor
Inspiring
December 8, 2012

Thanks. I'm going to give this a try. I'm using the AS3 version, so I think the change handler is a bit different, but I think I see where this is going.

And how/when do setNextFrameF and nextFrameF get called?

I'm thinking that setNextFrameF gets called by whichever button, function, mechanism that says, hey lets go to the next area.

And that nextFrameF is called from the exit_ frames after whatever clean up is done?

What is "rundown" and where does that come in?

And then all my paramaters and stuff are ignored by this bit of code, but can be passed of from the change handler to whatever needs to deal with it.

kglad
Community Expert
Community Expert
December 8, 2012

setNextFrameF and nextFrameF are called by your navigation buttons.  they won't trigger any navigation changes directly.  all navigation goes through one of those two functions.  the first uses swfaddress and the 2nd does not.

enter_rundown is the initial frame displayed.  there was a problem when the site was entered and then the browser back button clicked that was prevented by stopping the onChange code from executing.