Welcome, Guest. Please login or register.
Did you miss your activation email?
02/07/12, 09:13
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  Flash and AS 3 (Moderators: papachan, kofi addaquay)
| | |-+  how to add RSS Reader/Webpage into flash
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: how to add RSS Reader/Webpage into flash  (Read 885 times)
hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« on: 03/14/10, 03:09 »

Hello, do you know how to show the RSS Reader / webpage in my flash?..

In flash we that some component can load image from internet with UILoader, and
can we show the webpage?.. Or there some tools / script that we use?..

For Example i want to show the google page inside my flash, not open the url with flash, but inside my flash..
If open url with flash we use NavigateToURL right?.. Smiley

Sry for my poor english again~

Really2 need help for this case, a little help thats really appreciate..

Thank you very much Smiley
Logged

Huihihi~ Cheesy
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #1 on: 03/14/10, 09:39 »

Flash is not realy a browser.
So html-support is limited.

You can insert html content into a textArea by assigning the source to the htmlText attribut of the textArea.

I am not sure, if this is enough for google adds - never tried before Wink

Give feedback, if it works Cheesy
Logged

happy flashing
Cool
Ronald
hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« Reply #2 on: 03/14/10, 10:26 »

Okayyyyy Cheesy

I wanna try that first, then i will tell you the result later Smiley

Thank you very much Ronald Smiley
Logged

Huihihi~ Cheesy
hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« Reply #3 on: 03/16/10, 21:33 »

Hello, Ronald i got it~

How to insert RSS Reader / web page in our flash.. Smiley
U are right that use the HTML Text in the text Area.. Cheesy

First find the RSS Reader Service first then this is my script.. Smiley
Code:
var hinoXML:XML = new XML();
hinoXML.ignoreWhitespace = true;
var hinoXMLURL:String = "http://alaashaker.wordpress.com/feed/";
var hinoRequest:URLRequest = new URLRequest(hinoXMLURL);
var hinoLoader:URLLoader = new URLLoader();
hinoLoader.addEventListener(Event.COMPLETE, completeHandler);
hinoLoader.load(hinoRequest);
function completeHandler(event:Event):void {
hinoXML = new XML(hinoLoader.data);
for (var i:String in hinoXML.channel.item){
hinoList.addItem({label:""+hinoXML.channel.item[i].title});
}
}
function viewWebPage(evt:Event):void {
    var list:XMLList =
                hinoXML.channel.item[evt.target.selectedIndex].children();
    var item:XML;
    for(var i:Number = 0; i<list.length(); i++)
        if(list[i].name() == "description")
        { i++;break; }
    item = list[i].children()[0];
    hinoTextArea.htmlText = item.toString();
}
hinoList.addEventListener(Event.CHANGE, viewWebPage);

and this is the screenshoot.. Smiley



It seems that the RSS Service majority have the same tag in their XML..
<channel> for separating the Article
<title> for the title
<description> for the description
<link> for the link

Hope this help~ Smiley
Logged

Huihihi~ Cheesy
hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« Reply #4 on: 03/16/10, 21:41 »

To be Honest i have some strange looping there, can u tell me whats the difference of

Code:
for (blablabla) {
some code
}

and

Code:
for (blablabla)
some code

the looping between have some "{}" and not
**whats "{ or }" in english?..  Tongue**

because when i try to add some "{}" in
Code:
for(var i:Number = 0; i<list.length(); i++)
        if(list[i].name() == "description")            <<<<add here "{"
        { i++;break; }
    item = list[i].children()[0];                           <<and here "}"
    hinoTextArea.htmlText = item.toString();    <<or here "}"

the webpage didnt work well.. thank you.. Smiley

And whats the function of "name()" and "children()" in that

Code:
var list:XMLList =
                hinoXML.channel.item[evt.target.selectedIndex].children();
    var item:XML;
    for(var i:Number = 0; i<list.length(); i++)
        if(list[i].name() == "description")
        { i++;break; }
    item = list[i].children()[0];

ehehe to be honest several code i am copy paste for the reference that i got.. Smiley
but in that reference its didnt tell me about the function..

thank you Smiley

Logged

Huihihi~ Cheesy
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #5 on: 03/17/10, 08:04 »

the curley braces {} are to keep code blocks together.

if(condition=true){
do1
do2
do3
}

means if the condition is true, do1 then do2 then do3

same in loops everything inside of the braces belong together and are run sequentialy.
Logged

happy flashing
Cool
Ronald
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!