Flash Gallery | Flash Templates | Flash Menu | Flash Design | Flash Audio & Video

flash page flip

Actionscript 3.0 video tutorials

+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 31

Thread: Flash RSS reader

  1. #1
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,609
    Rep Power
    9

    Flash RSS reader

    flash templates

    FlepStudio has created a new free utility for Flash CS3-CS4.


    This is a scroller RSS reader.

    It reads any RSS feed, simply set the url of the feed.

    The RSS parse is done with a PHP script by Last RSS.


    Graphics easily configurable options and colors in the AS file.


    Very useful for those who want to share the feeds on its website using Flash.








    Included files:



    • main.fla

    • package org.FlepStudio: Main.as

    • package caurina by Zeh Fernando

    • file lastRSS.php created by Last RSS

    • file rss.php


    Options:


    Code:
    /****** CHANGE ABSOLUTE URL THAT POINTS TO rss.php file ******/
    private const PHP_PARSER_URL:String="http://flepstudio.org/utilita/RSSreader/rss.php";
    
    /****** INSERT HERE THE URL OF THE FEED YOU WANT TO DISPLAY ******/
    private const FEED_URL:String="http://feedproxy.google.com/FlashCs3AndFlashCs4Tutorials/";
    
    /****** COLOR OPTIONS ******/
    private const BACKGROUND_COLOR:uint=0x1F1F1F;
    private const BACKGROUND_HEADER_COLOR:uint=0x000000;
    private const HEADER_TITLE_TEXTCOLOR:uint=0xCCCCCC;
    private const ITEM_BACKGROUND_COLOR:uint=0x333333;
    private const ITEM_TITLE_COLOR:uint=0xFFFFFF;
    private const ITEM_READMORE_COLOR:uint=0x0066FF;
    private const ITEM_READMORE_ROLLOVER_COLOR:uint=0x00FFFF;
    
    /****** LINK OPTIONS ******/
    private const PAGE_TARGET:String="_blank";
    
    /****** SPEED OF TWEENS ( in seconds ) ******/
    private const TWEENS_SPEED:Number=1;

    Installation:



    1. Upload the files rss.php and lastRSS.php on your domain server

    2. Open main.fla e org/FlepStudio/Main.as and insert the url that points to rss.php ( PHP_PARSER_URL ) at line 19

    3. Open main.fla and org/FlepStudio/Main.as and insert the url of the feed you want to display at line 22

    4. Set colors other options

    5. Re-create main.swf from main.fla

    6. Upload main.swf


    Source files:

    Attached Files

  2. #2
    Junior Member Settled In vijay.singh21 is on a distinguished road
    Join Date
    Nov 2008
    Posts
    21
    Rep Power
    0

    Smile Re: Flash RSS reader

    Hi my self vijay.
    i download your file and tryied in my computer it is showing eroor:
    1046: Type was not found or was not a compile-time constant: TextField.
    what should i do any solution do u have to help me out..................
    thank u

  3. #3
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,609
    Rep Power
    9

    Re: Flash RSS reader

    Hi,
    open Main.as and add the following import:

    Code:
    import flash.text.*;

  4. #4
    Junior Member Settled In vijay.singh21 is on a distinguished road
    Join Date
    Nov 2008
    Posts
    21
    Rep Power
    0

    Thumbs up Re: Flash RSS reader

    hi
    thx for ur help its done.....................

  5. #5
    Junior Member Settled In klecknsr is on a distinguished road
    Join Date
    Jul 2008
    Posts
    7
    Rep Power
    0

    Re: Flash RSS reader

    Does it have the ability to auto scroll?

  6. #6
    Junior Member Settled In trinlico is on a distinguished road
    Join Date
    Sep 2008
    Posts
    1
    Rep Power
    0

    Re: Flash RSS reader

    Hi there,

    I can't seem to get this working.

    getting the following error

    Error #1009: Cannot access a property or method of a null object reference.
    at org.FlepStudio::Main/onComplete()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

    on uploading the blank main.swf box comes up then just takes ages transferring data from site... but then nothing happens.

    have i done something daft?

    x

  7. #7
    Junior Member Settled In vijay.singh21 is on a distinguished road
    Join Date
    Nov 2008
    Posts
    21
    Rep Power
    0

    Smile Re: Flash RSS reader

    hi trinlico,
    I think i can help u...........
    I think u have dint put the correct address of ABSOLUTE URL THAT POINTS TO rss.php file.
    so put the correct path and try again.......
    I think that i help u out....
    bye.

  8. #8
    Junior Member Settled In henrikglensbo is on a distinguished road
    Join Date
    Dec 2008
    Posts
    5
    Rep Power
    0

    Re: Flash RSS reader

    Hi I keep getting this error message 1198: Attributes are not allowed on package definition? Any ideas as to solve the problem?

    Thanks in advance

    Henrik

  9. #9
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,609
    Rep Power
    9

    Re: Flash RSS reader

    Quote Originally Posted by klecknsr View Post
    Does it have the ability to auto scroll?
    Auto scroll, change Main.as with the following code:
    Code:
    /*
     *************************************
     * Feeds Reader      
     * © Author: http://flepstudio.org
     * version 1.0                       
     *************************************
     */
    package org.FlepStudio
    {
    	import flash.display.*;
    	import flash.events.*;
    	import flash.net.*;
    	import flash.ui.*;
    	import caurina.transitions.Tweener;
    	
    	public class Main extends MovieClip
    	{
    		/****** CHANGE ABSOLUTE URL THAT POINTS TO rss.php file ******/
    		private const PHP_PARSER_URL:String="http://flepstudio.org/utilita/RSSreader/rss.php";
    		
    		/****** INSERT HERE THE URL OF THE FEED YOU WANT TO DISPLAY ******/
    		private const FEED_URL:String="http://feedproxy.google.com/FlashCs3AndFlashCs4Tutorials/";
    		
    		/****** COLOR OPTIONS ******/
    		private const BACKGROUND_COLOR:uint=0x1F1F1F;
    		private const BACKGROUND_HEADER_COLOR:uint=0x000000;
    		private const HEADER_TITLE_TEXTCOLOR:uint=0xCCCCCC;
    		private const ITEM_BACKGROUND_COLOR:uint=0x333333;
    		private const ITEM_TITLE_COLOR:uint=0xFFFFFF;
    		private const ITEM_READMORE_COLOR:uint=0x0066FF;
    		private const ITEM_READMORE_ROLLOVER_COLOR:uint=0x00FFFF;
    		
    		/****** LINK OPTIONS ******/
    		private const PAGE_TARGET:String="_blank";
    		
    		/****** SPEED OF TWEENS ( in seconds ) ******/
    		private const TWEENS_SPEED:Number=1;
    		private var SPEED:Number=1;
    		
    		// OTHER PROPERTIES DO NOT TOUCH THEM UNLESS YOU KNOW WHAT YOU ARE DOING
    		private var title_obj:Object=new Object();
    		
    		private var titles_array:Array=new Array();
    		private var links_array:Array=new Array();
    		private var items_array:Array=new Array();
    		
    		private var wheel_mc:Wheel;
    		
    		private var items_container_mc:MovieClip;
    		
    		// CONSTRUCTOR
    		public function Main()
    		{
    			addEventListener(Event.ADDED_TO_STAGE,init);
    		}
    		
    		// start the application
    		private function init(evt:Event):void
    		{
    			removeEventListener(Event.ADDED_TO_STAGE,init);
    			
    			stage.frameRate=31;
    			
    			hideMenu();
    			fixBackgroundAndColors();
    			showPreloader();
    			createHolder();
    			loadXML();
    		}
    		
    		// fix colors and background's size
    		private function fixBackgroundAndColors():void
    		{
    			wheel_mc=new Wheel();
    			
    			bg_mc.width=stage.stageWidth;
    			bg_mc.height=stage.stageHeight;
    			
    			Tweener.addTween(bg_mc,{_color:BACKGROUND_COLOR,time:TWEENS_SPEED,transition:"regular"});
    			Tweener.addTween(header_mc.bg_mc,{_color:BACKGROUND_HEADER_COLOR,time:TWEENS_SPEED,transition:"regular"});
    			Tweener.addTween(header_mc.title_mc,{_color:HEADER_TITLE_TEXTCOLOR,time:TWEENS_SPEED,transition:"regular"});
    		}
    		
    		// show the wheel preloader
    		private function showPreloader():void
    		{
    			wheel_mc.width=wheel_mc.height=30;
    			wheel_mc.x=stage.stageWidth/2-wheel_mc.width/2;
    			wheel_mc.y=(stage.stageHeight-header_mc.height)/2-wheel_mc.height/2+header_mc.height;
    			addChild(wheel_mc);
    		}
    		
    		// remove the wheel preloader
    		private function hidePreloader():void
    		{
    			wheel_mc.stop();
    			Tweener.addTween(wheel_mc,{alpha:0,time:TWEENS_SPEED,transition:"regular",onComplete:removeMe});
    			
    			function removeMe():void
    			{
    				removeChild(wheel_mc);
    			}
    		}
    		
    		// create the items MovieClip container
    		private function createHolder():void
    		{
    			items_container_mc=new MovieClip();
    			items_container_mc.y=50;
    			addChild(items_container_mc);
    			swapChildren(header_mc,items_container_mc);
    		}
    		
    		// calling PHP parser
    		private function loadXML():void
    		{
    			var request:URLRequest=new URLRequest(PHP_PARSER_URL);
    			var variables:URLVariables=new URLVariables();
    			variables.feed_url=FEED_URL;
    			request.method=URLRequestMethod.POST;
    			request.data=variables;
    			var loader:URLLoader=new URLLoader();
    			loader.dataFormat=URLLoaderDataFormat.VARIABLES;
    			loader.addEventListener(Event.COMPLETE,onComplete);
    			loader.load(request);
    		}
    		
    		// PHP returns
    		private function onComplete(evt:Event):void
    		{
    			var vars:URLVariables=new URLVariables(evt.target.data);
    			var titles:String=vars.titles;
    			var links:String=vars.links;
    			
    			title_obj.title=vars.title;
    			title_obj.link=vars.link;
    			titles_array=titles.split(",");
    			links_array=links.split(",");
    			
    			hidePreloader();
    			initHeaderText();
    			createItems();
    			addMovement();
    		}
    		
    		// assign text to header
    		private function initHeaderText():void
    		{
    			header_mc.title_mc.title_txt.htmlText=title_obj.title;
    			header_mc.title_mc.title_txt.width=header_mc.title_mc.title_txt.textWidth+10;
    			header_mc.title_mc.title_txt.height=header_mc.title_mc.title_txt.textHeight+10;
    			header_mc.title_mc.title_txt.x=header_mc.width/2-header_mc.title_mc.title_txt.width/2-10;
    			header_mc.title_mc.title_txt.y=25-header_mc.title_mc.title_txt.height/2;
    			
    			header_mc.title_mc.mouseChildren=false;
    			header_mc.title_mc.buttonMode=true;
    			header_mc.title_mc.addEventListener(MouseEvent.MOUSE_DOWN,onHeaderDown);
    		}
    		
    		// create and position all the items
    		private function createItems():void
    		{
    			for(var i:int=0;i < titles_array.length;i++)
    			{
    				var item:Item=new Item();
    				item.id=i;
    				Tweener.addTween(item.bg_mc,{_color:ITEM_BACKGROUND_COLOR,time:TWEENS_SPEED,transition:"regular"});
    				Tweener.addTween(item.title_txt,{_color:ITEM_TITLE_COLOR,time:TWEENS_SPEED,transition:"regular"});
    				Tweener.addTween(item.read_mc,{_color:ITEM_READMORE_COLOR,time:TWEENS_SPEED,transition:"regular"});
    				item.title_txt.y=10;
    				item.title_txt.htmlText=titles_array[i];
    				item.title_txt.height=item.title_txt.textHeight+10;
    				item.read_mc.y=item.title_txt.y+item.title_txt.textHeight+10;
    				item.bg_mc.height=item.read_mc.y+item.read_mc.height+10;
    				item.x=5;
    				items_array.push(item);
    			}
    			
    			for(var j:int=0;j < items_array.length;j++)
    			{
    				if(j>0)
    					items_array[j].y=items_array[j-1].y+items_array[j-1].height+2;
    				items_container_mc.addChild(items_array[j]);
    				
    				items_array[j].read_mc.mouseChildren=false;
    				items_array[j].read_mc.buttonMode=true;
    				items_array[j].read_mc.addEventListener(MouseEvent.MOUSE_OVER,onReadOver);
    				items_array[j].read_mc.addEventListener(MouseEvent.MOUSE_OUT,onReadOut);
    				items_array[j].read_mc.addEventListener(MouseEvent.MOUSE_DOWN,onReadDown);
    			}
    		}
    		
    		// add the scrolling mouse position movement
    		private function addMovement():void
    		{
    			items_container_mc.addEventListener(Event.ENTER_FRAME,moveItems);
    		}
    		
    		// check mouseY and move items
    		private function moveItems(evt:Event):void
    		{
    			evt.target.y-=SPEED;
    			
    			if(evt.target.y<-evt.target.height+375)
    				SPEED*=-1
    			if(evt.target.y>=50)
    				SPEED*=-1;
    		}
    		
    		// this method is called when mouse is over read more button area
    		private function onReadOver(evt:MouseEvent):void
    		{
    			Tweener.addTween(evt.target,{_color:ITEM_READMORE_ROLLOVER_COLOR,time:TWEENS_SPEED,transition:"regular"});
    		}
    		
    		// this method is called when mouse is out of read more button area
    		private function onReadOut(evt:MouseEvent):void
    		{
    			Tweener.addTween(evt.target,{_color:ITEM_READMORE_COLOR,time:TWEENS_SPEED,transition:"regular"});
    		}
    		
    		// this method is called when read more button has been clicked
    		private function onReadDown(evt:MouseEvent):void
    		{
    			var request:URLRequest=new URLRequest(links_array[evt.target.parent.id]);
    			navigateToURL(request,PAGE_TARGET);
    		}
    		
    		// this method is called when the title header has been clicked
    		private function onHeaderDown(evt:MouseEvent):void
    		{
    			var request:URLRequest=new URLRequest(title_obj.link);
    			navigateToURL(request,PAGE_TARGET);
    		}
    		
    		// MY RIGHTS
    		public function hideMenu():void
    		{
    			var label:String="FlepStudio";
    			var cm:ContextMenu=new ContextMenu();
    			var item:ContextMenuItem=new ContextMenuItem(label);
    			cm.hideBuiltInItems();
    			cm.customItems.push(item);
    			item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,itemHandler1);
    			this.contextMenu=cm;
    		}
    		private function itemHandler1(event:ContextMenuEvent):void
    		{
    			var request:URLRequest=new URLRequest();
    			request.url="http://flepstudio.org/";
    			navigateToURL(request,"_self");
    		}
    	}
    }

  10. #10
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,609
    Rep Power
    9

    Re: Flash RSS reader

    Quote Originally Posted by henrikglensbo View Post
    Hi I keep getting this error message 1198: Attributes are not allowed on package definition? Any ideas as to solve the problem?

    Thanks in advance

    Henrik
    Let me see the code you are using please.

+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast

Similar Threads

  1. UEFA RSS reader
    By Flep in forum FlepStudio utilities
    Replies: 17
    Last Post: 26-05-10, 16:52
  2. Twitter RSS reader
    By Flep in forum FlepStudio utilities
    Replies: 26
    Last Post: 07-04-10, 12:29

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts