i agree with kenneth - swf address forms the basis of my navigation

i take the current url from the swfaddress event in my model, pass it
through a function to make sure the url exists and then dispatch the page
change event to the rest of the application which updates the page view and
the navigation

a

On 5 May 2010 19:28, Kenneth Kawamoto <kennethkawam...@gmail.com> wrote:

> If I understood you correctly, you want to filter the XML data according to
> a variable passed to the SWF. If so you'd do something like:
>
> var pageDetails:String = xmlData.PAGE.(@pg_name ==
> loaderInfo.parameters.page).DETAILS;
> // "page" is the name of the var passed to the SWF here
>
> But I strongly recommend you to have a look at SWFAddress, which is
> absolutely indispensable framework if you are creating a site driven by
> dynamic data ;)
>
>
> Kenneth Kawamoto
> http://www.materiaprima.co.uk/
>
> John Singleton wrote:
>
>> ----- Original Message ----
>>
>>  From: "kennethkawam...@gmail.com" <kennethkawam...@gmail.com>
>>> To: Flash Coders List <flashcoders@chattyfig.figleaf.com>
>>> Sent: Wed, May 5, 2010 12:48:28 PM
>>> Subject: Re: [Flashcoders] XML Question
>>>
>>> Say for example you are in the home section and obtaining the data for
>>>
>> it,
>>
>>> you'd do:
>>>
>>
>>  var pageData:XML = xmlData.PAGE.(@pg_name == "index")[0];
>>>
>>> Then build the page based on pageData XML.
>>>
>>
>> k. Now, how can I build a switch statement to determine which page? I plan
>> to pass a var to my swf, then call the data based on the value of the var
>> (in this case, "index"). As stated previously, my switch statement, for
>> reasons I don't understand, is giving me the value "indexcontent"; that is,
>> all the values of pg_name:
>>
>>        function completeXMLListener(e:Event):void
>>        {
>>            var xmlData:XML = XML (e.target.data);
>>            trace(xmldata.pa...@pg_name.tostring())
>>            switch (xmldata.pa...@pg_name.tostring())
>>            {
>>                case "index":
>>                    pageDetails = xmlData.PAGE.DETAILS.toString();
>>                    break;
>>                case "contact":
>>                    pageDetails = xmlData.PAGE.DETAILS.toString();
>>                    break;
>>                default:
>>                    pageDetails = xmlData.PAGE.DETAILS.toString();
>>                    trace(pageDetails);
>>                    break;
>>            }
>>            MyTextBlock();
>>        }
>>
>> TIA,
>> John
>>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to