Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Images Scroller

This is a discussion on Images Scroller within the FlepStudio utilities forums, part of the Tutorials category; ok typical, when you ask for help, all of a sudden it comes to you it seems the images.xml ...


Go Back   Forum Flash CS3 Flash CS4 > English Forums > Tutorials > FlepStudio utilities

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #21 (permalink)  
Old 13-01-08, 23:17
Junior Member
 
Join Date: Jan 2008
Posts: 4
Rep Power: 0
PLUGGER is on a distinguished road
Re: Images Scroller

ok typical, when you ask for help, all of a sudden it comes to you


it seems the images.xml file must be in the main dir that you have the php or html file in


but thats anyways and i love this script, thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #22 (permalink)  
Old 14-01-08, 10:30
Junior Member
 
Join Date: Jan 2008
Posts: 4
Rep Power: 0
PLUGGER is on a distinguished road
Re: Images Scroller

ok a quick question for you

the images (thumbnails) i want to use are small images 145x120

now i need the popu to load a different image, because i want to add text to the bottom of the image

so can you tell me how i can make it load thumbnails and how i can have it load the pop0.html as how i edit the pop0.html file

if you understand me

thumnails and main images need to be independant
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #23 (permalink)  
Old 30-01-08, 21:08
Junior Member
 
Join Date: Jan 2008
Posts: 4
Rep Power: 0
PLUGGER is on a distinguished road
Re: Images Scroller

anyone got any ideas for the above question

i would be gratefull if there is a solution to this
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #24 (permalink)  
Old 31-01-08, 04:58
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,489
Rep Power: 6
Flep is on a distinguished road
Re: Images Scroller

Hi

Just change the images into the popups...
isn't it ?
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #25 (permalink)  
Old 11-04-08, 16:46
Junior Member
 
Join Date: Apr 2008
Posts: 2
Rep Power: 0
Barton68 is on a distinguished road
Re: Images Scroller

Hi,
you've created some great components....
Can the component be configured, XML or HTML, to automatically start scrolling? Also, anyway to switch off the mouse the mouse reverse direction and speed increase?
Thanks again,
Mark.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Flash Multi Gallery
  #26 (permalink)  
Old 16-06-08, 18:09
Junior Member
 
Join Date: Jun 2008
Posts: 1
Rep Power: 0
IrfanZaidi is on a distinguished road
Re: Images Scroller

Can you please tell me how to restrict popup. I want the links on images to open in the same window.
This is really urgent, can anyone please help me to resolve this.

Many Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #27 (permalink)  
Old 20-06-08, 00:16
Junior Member
 
Join Date: Jun 2008
Location: Chicago, IL
Posts: 1
Rep Power: 0
Lana is on a distinguished road
Re: Images Scroller

Hi! I love this scroller.....I have a question, how do you make it so that it starts scrolling itself? without having to rollover with the mouse.....

thanks in advance!
~L~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #28 (permalink)  
Old 14-07-08, 20:57
Junior Member
 
Join Date: Jan 2008
Posts: 2
Rep Power: 0
maconbot is on a distinguished road
Lightbulb Re: Added more features to Images Scroller

Hi Flep,

My first time contacting you. I must tell you, your work with utilities has been instrumental in taking me from novice to intermediate. So a big thank you!

I have added some more features to the ImagesScoller, however I can't figure out a way to make the name of the XML file dynamic and how to link what XML file gets pulled to a combobox. Here is the link...
main

Long term, the combobox will be populated from an SQL database. And XML files, will be added with a certain naming convention created via a PHP script, which will also link SQL database names with XML file names and locations.

The only code I have changed is in Main.as. My thought was I was going to have LoadingXML.as dynamically pull from a .txt file. And everytime a new "Item" was "selected" in the comboBox, flash would write URLvairables to that txt file, and then when LoadingXML was forced to UPDATE it would pull the myComboBox.selectedItem name , now stored in the txt file, and change what XML file it is opening.

I have tried this in a couple different ways, I can see that the problem lies in REFRESHING the Arrays, if I knew how to load "LoadingXML.as" fresh everytime a comboBox Item was selected, I would be done. But I don't know how to removeChild so to speak the Arrays and finally how to call back up "loadImages()" and have it load LoadingXML fresh everytime. Where in LoadingXML I would place...

Code:
 //Create the URLLOader instance
 var myLoader:URLLoader = new URLLoader()
 //the data will come as URL-encoded variables
 myLoader.dataFormat = URLLoaderDataFormat.VARIABLES
 //Load using an URLRequest, even beeing local
 myLoader.load(new URLRequest("refXML.txt"))
 //onLoad handler listener
 myLoader.addEventListener(Event.COMPLETE, onDataLoad)
 //Error handling 
 myLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError)
 myLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError)
 //Could be an error or just a message
 myLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus)    
 //add a listener for the complete event
 function onDataLoad(evt:Event){
  Title_txt.htmlText = evt.target.data.Title 
 }
 //error callbacks
 function onIOError(evt:IOErrorEvent){
  trace("IOError: "+evt.text)
 }
 function onHTTPStatus(evt:HTTPStatusEvent){
  trace("HTTPStatus: "+evt.status)
 }
 function onSecurityError(evt:SecurityErrorEvent){
  trace("SecurityError: "+evt.text)
 }
stop()
and do something like this to your LoadingXML.as code

Code:
private function loadXML():void
  {
   var loader:URLLoader=new URLLoader();
   loader.addEventListener(Event.COMPLETE,completeHandler);
 
   // Cambia l'url del file XML 
   var request:URLRequest=new URLRequest(evt.target.data.Title + ".xml");
   try
etc..., etc...


Finally, here is the modified Main.as
Code:
/*
 *************************************
 * Images Scroller
 * Flash CS3 Blog con Tutorial e risorse per Flash cs3 e Actionscript 3.0         
 * © Author: Filippo Lughi           
 * version 1.0                       
 *************************************
 */
package
{
 //Mix - Slider and TextInput, FlepStudio
 import flash.display.MovieClip;
 import flash.display.Sprite;
 import flash.display.Loader;
 import flash.text.TextField;
    import flash.text.TextFieldType;
    import flash.text.TextFieldAutoSize;
 //FlepStudio
    import flash.events.TextEvent;
 import flash.utils.Timer;
 import flash.events.TimerEvent;
 import flash.events.Event;
 import flash.events.MouseEvent;
 import flash.net.URLRequest;
 import flash.net.navigateToURL;
 import flash.system.Security;
 import fl.events.SliderEvent;
 //ComboBox
 import fl.controls.Button;
 import fl.controls.ComboBox;
 import fl.controls.List;
 
 public class Main extends MovieClip
 {
  public var file_xml:LoadingXML;
 
  public var objects_array:Array;
  public var pics_array:Array;
 
  public var container_mc:MovieClip;
  public var gal_ctnr_mc:MovieClip;
  public var gal_combo_ui:MovieClip;
 
  private var counter:int=0;
  private var ratio:Number;
  private var speed:int=1;
 
  private var boo:Boolean=true;
 
  private var inputTextField:TextField = new TextField();
  private var result:String = "";
  public var tim:Timer = new Timer(50);
  public var xInc:Number = 100;
 
  public function Main()
  {
   Security.LOCAL_TRUSTED;
   init();
   loadXML();
   configureListeners();
   TextEvent_TEXT_INPUT();
   galleryCombo();
  }
 
  private function init():void
  {
   stage.frameRate=31;
 
   objects_array=new Array();
   pics_array=new Array();
 
   container_mc=new MovieClip();
   addChild(container_mc);
   gal_ctnr_mc=new MovieClip();
   addChild(gal_ctnr_mc);
   gal_combo_ui=new MovieClip();
   addChild(gal_combo_ui);
  }
 
  private function loadXML():void
  {
   file_xml=new LoadingXML(this);
  }
 
  //ComboBox - Start
  private function galleryCombo():void
  {
   var myComboBox:ComboBox = new ComboBox();
   myComboBox.prompt = "Select an item";
   myComboBox.addItem({label:"images"});
   myComboBox.addItem({label:"Item B"});
   myComboBox.addItem({label:"Item C"});
   myComboBox.move(10, 10);
   myComboBox.addEventListener(Event.CHANGE, clickHandler);
   gal_combo_ui.addChild(myComboBox);
   var myList:List = new List();
   myList.rowCount = myList.length;
   myList.selectable = false;
   myList.move(myComboBox.x, myComboBox.y + myComboBox.height + 10);
   gal_combo_ui.addChild(myList);
 
   function clickHandler(event:Event):void 
   {
       if (myComboBox.selectedIndex > -1) 
    {
     configureListeners();
       }
   }
  }
  //ComboBox - End
 
  //Sliders and InputText - Start
  public function TextEvent_TEXT_INPUT() 
  {
   inputTextField.x = 800;
   inputTextField.y = 400;
   inputTextField.border = true;
   inputTextField.type = TextFieldType.INPUT;
   inputTextField.addEventListener(TextEvent.TEXT_INPUT, textInputHandler);
   this.addChild(inputTextField);
  }
 
  private function textInputHandler(event:TextEvent):void 
  {   
            var numExp:RegExp = /[0-9]/;
   event.preventDefault();  
            inputTextField.text = result;                
            inputTextField.setSelection(result.length + 1, result.length + 1);
 
            if (inputTextField.text.length == 1 || inputTextField.text.length == 2) 
   {
                if(numExp.test(event.text) == true) 
    {
                    updateCombination(event.text);
                } 
    else 
    {
                    sliderLabel.text = "input type numeric";
                }
   }
   else
   {
    if(numExp.test(event.text) == true) 
    { 
                    updateCombination(event.text);
                }
    else
    {
                    sliderLabel.text = "input type numeric";
                }
            }
            if(inputTextField.text.length == 2)
   {
    posX();
    result="";
         }
  }
 
  private function posX():void
  {
   sliderLabel.text = "";
   gal_ctnr_mc.x = xInc + Number(inputTextField.text);
  }
 
  private function updateCombination(s:String):void 
  {
   sliderLabel.text = "";
   result += s;           
   inputTextField.text = result;
   inputTextField.setSelection(result.length + 1, result.length + 1);
        }
 
  private function configureListeners():void 
  {
            slider.addEventListener(SliderEvent.CHANGE, sliderChanged);
            slider.addEventListener(SliderEvent.THUMB_DRAG, sliderDrag);
  }
 
  private function sliderDrag(e:SliderEvent):void {
            trace("Slider dragging: " + e.target.value);
            inputTextField.text = e.target.value;
   posX();
        }
        private function sliderChanged(e:SliderEvent):void {
            inputTextField.text = e.target.value;    
        }
  //Sliders and InputText - End
 
  public function loadImages():void
  {
    var caricatore:Caricatore=new Caricatore(this,objects_array[counter].image,counter);
    counter++;
  }
 
  public function positionClips():void
  {
   removeChild(loading_txt);
   removeChild(info_txt);
 

   for(var i:int=0;i
    {
    if(i>0)
     pics_array[i].x=pics_array[i-1].x+pics_array[i-1].width;
    pics_array[i].visible=true;
   }
 
   ratio=-container_mc.width/stage.stageWidth;
 
   addListeners();
   addMouseListeners();
   moveContainer();
  }
 
  private function addListeners():void
  {

   for(var i:int=0;i
    {
    pics_array[i].addEventListener(MouseEvent.MOUSE_DOWN,openPopUp);
   }
  }
 
  private function addMouseListeners():void
  {
   stage.addEventListener(MouseEvent.MOUSE_MOVE,mouseIsMoving);
   stage.addEventListener(Event.MOUSE_LEAVE,mousehasGone);
  }
 
  private function mouseIsMoving(evt:MouseEvent):void
  {
   boo=true;
  }
 
  private function mousehasGone(evt:Event):void
  {
   boo=false;
  }
 
  private function moveContainer():void
  {
   container_mc.addEventListener(Event.ENTER_FRAME,moveMe);
  }
 
  private function moveMe(evt:Event):void
  {
   if(boo)
   {
    var arrX:Number=mouseX*ratio+stage.stageWidth/2;
    var dx:Number=arrX-evt.currentTarget.x;
    var ax:Number=dx*.1;
    evt.currentTarget.x+=ax;
    check(evt.currentTarget as MovieClip);
   }
   else
   {
    evt.currentTarget.x-=speed;
    check2(evt.currentTarget as MovieClip);
   }
  }
 
  private function check(m:MovieClip):void
  {
   if(m.x<-m.width+stage.stageWidth)
    m.x=-m.width+stage.stageWidth;
   else if(m.x>0)
    m.x=0;
  }
 
  private function check2(m:MovieClip):void
  {
   if(m.x<=-m.width+stage.stageWidth)
    speed*=-1;
   else if(m.x>=0)
    speed*=-1;
  }
 
  private function openPopUp(evt:MouseEvent):void
  {
   var logoLoader:Loader=new Loader();
   var galleryLoader:URLRequest=new URLRequest(objects_array[evt.currentTarget.id].pop);
   logoLoader.load(galleryLoader);
 
   var total:uint = gal_ctnr_mc.numChildren;
   if (total > 0)
   {
    gal_ctnr_mc.addChildAt(logoLoader,0);
    logoLoader.x = 0;
    logoLoader.y = 150;
    gal_ctnr_mc.removeChildAt(1);
   }
   else
   {
    gal_ctnr_mc.addChildAt(logoLoader,0);
    logoLoader.x = 0;
    logoLoader.y = 150;
   }
  }
 }
}
Please let me know if I have not provided enough information. If this project gets picked up, I would like to give you credit or donate or something. Let me know what you prefer.

Thanks for your awesome work!
-maconbot
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #29 (permalink)  
Old 18-07-08, 06:21
Junior Member
 
Join Date: Jan 2008
Posts: 2
Rep Power: 0
maconbot is on a distinguished road
Lightbulb Re: Images Scroller Document Class

After progressing more I realized the best solution was to force myself to study your tutorial on how to load an external SWF that has it's own document class. It gets really mind bogging when you are not used to thinking "the right way" on how to organize ones classes. But like you say, step by step...I am getting it!

Thanks again for all your work!
-maconbot

PS I attached the file. I've changed some of the properties and function names to terms that make sense to me in how I am understanding Flash.
Attached Files
File Type: zip DocClass_ImageScroller_DoNotTouch.zip (1.42 MB, 18 views)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #30 (permalink)  
Old 17-09-08, 16:04
Junior Member
 
Join Date: Sep 2008
Posts: 1
Rep Power: 0
Eddette is on a distinguished road
Re: Images Scroller

Hi Flep,

Thank you for this!

I am having some problems getting this to work in my website. I am new to Flash CS3.

I changed the scroller to show vertically, but for some reason the images do not want to load? What am I doing wrong?

Have a look at what it does: http://almost-new.co.uk/main.html

Please help!!

Last edited by Onsitus; 18-09-08 at 11:51..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Illusion - images gallery Flep FlepStudio utilities 9 17-11-08 06:31
FullScreen images gallery Flep FlepStudio utilities 3 13-11-08 15:51
unload images karonte Actionscript 3.0 base 2 14-05-08 20:01
Scroll Continuo Images Scroller soteha AIUTO utilitą free 13 29-02-08 12:22
Grey scale images with Actionscript 3.0 Flep Tutorials 0 27-09-07 21:04


All times are GMT. The time now is 20:02.


Powered by vBulletin versione 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406