ActionScript 3.0 :: Sending Current Sprite To Loader Function For Image Gallery?

Nov 30, 2010

I have set up a functioning xml image gallery with simple left and right arrows. I am now trying to make it an infinite looping gallery swapping the first and last sprites in an array and + and - their x value so they "physically" move in the photos container.

All of this works fine except for the actual loaded image. The xml data, name description, and image to be loaded are set up in one function and all the data is added to the sPhotoSprite (sprite) in this function. This All works perfectly..

A second function is then called to add the current image:

var currentImage:Loader = Loader(evt.target.loader);
then currentSprite.addChild(currentImage); (the sprite is declared at the start)

The problem being that the sPhotosSprite is no longer reference-able. I've tried :

imageLoader.contentLoaderInfo.addEventListener(Eve nt.COMPLETE, function( evt:Event)
{ imageLoaded( evt, sPhotosSprite )
} );

But this only ever returns the final sprite. The same problem of only ever returning the final sprite occurs when I try setting an external sprite to hold the current sprite in it and then referencing it in the second function.

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Image Loader Gallery - Put A Timer - Divert To The Next Image Automatically

Apr 30, 2010

I have this piece of code to change images. I was trying to figure out how you could put a timer on the code, so if the image has been displayed for say 5 seconds it diverts to the next image automatically? Also if it's not to hard, when it has played to the end to divert to the 1st image.

[Code]...

View 1 Replies

ActionScript 3.0 :: Position A Loader Image Inside A Sprite?

Sep 18, 2009

In AS3 / CS4 I'm trying to programmatically create a bunch of rectangular objects, let's call them 'cards', that will contain an image and a colored background and eventually some other elements like text.  I want to create alot of these cards and move them around inside of a larger panel (also a Sprite) of sorts.  I can successfully create colored rectangles in my cards and place the cards where I want in the panel, but whenever I try to add an image to a card, I can't seem to position the image inside the card's coordinate space, it ends up being placed inside the larger panel's coordinate space instead, even though I'm adding the image/loader as a child of the card.  I thought maybe it had something to do with having to wait until the image loading was complete, so I added the listener as a test but that didn't work.  Here's the code:

[Code]...

View 1 Replies

Object Loader Info - Which Image Is In A Sprite When Clicked

Feb 3, 2009

I've got a few spites on stage that are created dynamically and live in an array. I'm rotating images through these sprites and now need to know which image is in a sprite when clicked. My code: loading the images:

[Code]...

View 1 Replies

ActionScript 3.0 :: XML Loader - Dynamic Image Gallery

Oct 14, 2008

I'm trying to do a gallery with an XML file. My XML file is organized like that :

<images>
<image chemin="images/Palmares.jpg" titre="Palmares"
commentaire="Chamonix" />
</images>

The picture loader is working well and the text too but it doesn't work so well together. When I'm clicking on a sticker, the picture is load and a text too but it's not the good one.

View 6 Replies

Professional :: Add A Loader To An Image Gallery Loading Content Using Only Actionscript

Jul 26, 2010

i am loading all thumbs and  images in a container on a single frame using action script..but the  size of the swf becomes 1.2 mb so i want to add a loader to it...the  loader i am trying to add counts the frames but my file has just one  frame so the loader doesnot show up..

here is the script of my  gallery..and the timeline has just one frame...

import mx.transitions.Tween;import  mx.transitions.easing.*;
this.createEmptyMovieClip("container",1);var  imagesNumber:Number = 18;var scrolling:Boolean = true;
for (i=1;  i<=imagesNumber; i++) {container.attachMovie("thumb"+i,"thumb"+i+"_mc",i);myThumb_mc  = container["thumb"+i+"_mc"];if (i==1){    myThumb_mc._x =  (0.0)*myThumb_mc._width;

[Code].....

View 1 Replies

ActionScript 3.0 :: Image Viewer And Im Loading An Image To A Loader And Then Add The Loader To The Stage?

Aug 12, 2009

im working on an image viewer and im loading an image to a loader and then add the loader to the stage.I want the user to be able to drag and drop the image but since it's a loader i dont know how to do it.
I tried

imageLoader.startDrag = true;
imageLoader.content.startDrag = true;
 
but im getting an error on both.

View 2 Replies

IDE :: ThumbNailScroller Function - Adding A Thumbnail To An Image Gallery

Aug 2, 2008

I was reading your tutorial on adding a thumbnail to an image gallery. Im trying to use your thumbnail_final.fla inside another movie and is not working for me. I made a movie, in Scene 1 of this movie i have an empty movie clip(DisplayArea) and a menu button(Gallery) so that when i hit the Gallery button it load the thumbnail)final movie into the empty movie clip DisplayArea. Everything work except for the thumbNailScroller function. It load all the thumbnails and you can click them and they load the matching big picture and all but the scrolling function is not working.

[Code]...

View 3 Replies

ActionScript 3.0 :: Get Loaded Sprite From Loader?

Dec 21, 2011

I want to get my star to use one of the loaded sprites, I manage to find the correct urlLoader in my loader, but are unsure what I should return to give it the sprite.[code]...

View 2 Replies

ActionScript 3.0 :: Get This Loader To Unload The Current Picture Before Loading In A New One?

Feb 2, 2010

I'm trying to to get this loader to unload the current picture before loading in a new one. how I can put that in?

ActionScript Code:
function loadPhoto(url:String):void {
var picLoader:Loader = new Loader();

[code]...

View 2 Replies

ActionScript 3.0 :: Sprite Loader From Library Onto The Stage?

Jan 30, 2009

Loading a Sprite or MovieClip from the library to the Stage is simple. You just export the symbol and do the following code:

var mySp:Sprite1 = new Sprite1();
addChild(mySp)

assuming the exported sprite is called "Sprite1" and the base class is flash.display.Sprite

But what if you have many sprites and want to encapsulate this into a function with the sprite name passed as a string? What would the code in the function look like? Somehow you have to cast the string as the name of the sprite class defined in your export but I'm not sure how. I've seen a sample using the "as" keyword but try searching "as" in the help you you don't get much help.

Code:
function loadSpriteFromLibrary(sSpriteName:String)
{
//load the sprite with an exported name passed into sSpriteName onto the stage
//what would the code look like?
}

View 2 Replies

Flash :: Convert From DisplayObject To Sprite With Loader?

Jun 29, 2011

Do you know why this AS3 code works:

var loader = new Loader();
loader.load(new URLRequest("http://127.0.0.1/items/boing.png")));
var o:DisplayObject = addChild(loader);
o.x = 100;
o.y = 100;

But if I cast to sprite it doesn't work? Ie the sprite appears on (0, 0) instead of (100, 100):

var loader = new Loader();
loader.load(new URLRequest("http://127.0.0.1/items/boing.png"))
var o:Sprite = Sprite(addChild(loader));
o.x = 100;
o.y = 100;

How would I properly have a sprite instead of a DisplayObject? I need some sprite's features (drag'n drop, useHandCursor...), yet I wish I could still use the very quick writing with the loader.

View 2 Replies

Flash :: Copy To Bitmap Loaded In Sprite From Loader

Feb 25, 2010

I want to load an external image (dest) and display it on the stage, and i want to load another image (src) which will not be visible. When i hold the left mouse button on the image that appears on the stage, then a function that start copies the src image to the dest will be invoked. Actually i want to reproduce the scratch effect on an image that hides another underneath. here is my code [ the copypixels function is triggered on mouse_move event for debug purposes ]

package
{
import flash.display.Sprite;
import flash.display.BitmapData;

[Code]....

Although the two images are loaded into memory and the first one is shown on the stage, when the mouse_move events triggers the corresponding handlers the copy does not work.

View 1 Replies

ActionScript 3.0 :: External Assets - Multiple Loader Sprite Instance

Jul 27, 2010

I'm loading some external assets with the Loader class. I've done this a lot over the years, but seem to be coming across a problem I haven't had before. I want to display two instances on the stage at the same time of a .png I'm loading externally. If I use the Loader instance's contentLoaderInfo.content object in more than one sprite, the bitmap just "moves" from the first instantiated sprite to the second. I've tried duplicating the sprite with Senocular's duplicateDisplayObject class, but for some reason, it's not working right. But shouldn't I be able to use multiple instances of an imported bitmap like this just as if it were in the library of the .fla? If so, what do I need to do?

View 3 Replies

ActionScript 3.0 :: Portfolio Slideshow - Current Image Slide Out As The New Image Slides In

Sep 30, 2010

I'm fairly new to ActionScript 3.0 so forgive me if this question is easy, but I'm having issues with my portfolio slideshow. I have a few thumbnails and when you click on one the image slides in from the right. That part is fine. What I really want is for the user to click on a different random thumbnail and have the current image slide out as the new image slides in. My code so far:

[Code]...

View 1 Replies

Actionscript 3 :: Getting Data From Function Loaded After Current Function?

Mar 18, 2010

I have 2 functions, 1 loaded before another. Some value are determine by the other function data, but since one of it has to load before the other 1, how should I get the data that is loaded after current function?

private function wMessage():void {
Message.width=Name.width+20;
}

[Code]....

I've taken out some other unnecessary codes, but as you can see Name position is set according by the position + width of Message, but I want Message's width to be not smaller than Name

View 1 Replies

ActionScript 2.0 :: Flash XML Gallery ... Preload A Photo While Showing The Current One

Aug 9, 2006

i cannot seem to find any tutorial around this... when i click the next button, a new photo begins preloading (showing a loadbar or similar) *WHILE* the current photo is still in sight... after loading is complete loadbar and current photo fade out and the new photo fades-in in glorious color... something like the one used in [URL]

View 1 Replies

IDE :: Make Thumbnail Gallery - First Page Title Gallery Then Big Image With Description

Feb 6, 2009

i was looking for gallery looking like this site [URL] i was looking gallery first page title gallery then Big image like this with description.

View 1 Replies

ActionScript 2.0 :: Photo Gallery XML - Html File Shows The Extra Image In The Gallery But The Swf Doesn't

Feb 17, 2008

i am trying to add extra images to the photo gallery attached. I would have thought it is easy and it seems so. I add an extra image to the gallery. I publish it. The html file shows the extra image in the gallery but the swf doesnt. driving me crazy, cant work it out?

View 14 Replies

Professional :: Convert A JQuery Lightbox Style Gallery Into A Flash XML Based Image Gallery With Categories?

Oct 26, 2010

I've made a gallery slideshow before but wasn't as intuitive looking back at it now and I want to start fresh on this new project. I would like to convert a jQuery lightbox style gallery into a flash XML based AS3 image gallery with categories. I don't want to code the FLA, I want separate AS files.

This is a school project for my website. I would use jQuery and I have more experience with it but this project needs a flash component. I'm just not sure where to start and looking for some advice on how and where I could find resources. I want it to be minimal as I can make it;

- 8 thumbnails to a "page/section" with more flowed into page 2 or 3 etc. (or a srcoller)

- a few buttons for categories

- images fading in full size with a description when hovered over and a close button

- preloader (simple bar)

Esentially something like this > http:[url].........works which is using http:[url].... for the thumbnails. That might be ambitious but I'd suffice with a simple fade effect.I've downloaded some galleries out there but most of the code is messy or outdated.http:[url]... this is alright, but all the code is done in the FLA. I might break it into AS files but it depends.

View 1 Replies

ActionScript 3.0 :: Pre Loader Into Gallery?

Oct 1, 2011

I'm making a flash gallery with a pre loader on the first frame and on the second frame is the content.
 
The pre loader works, and loads up my first gallery image but then I can not proceed to view any more when I click my gallery buttons. Previously without the pre loader the buttons worked fine.

[Code]...

View 1 Replies

ActionScript 3.0 :: Gallery - Loading Thumbs From An Xml File And Placing Them Into One Container (sprite)

Jan 31, 2009

I am loading thumbs from an xml file and placing them into one container (sprite), which i later use for scrolling based on mouse position with this formula:

[Code]...

View 3 Replies

IDE :: Positioning Loader, XML, Swfs, Gallery?

May 20, 2009

This is driving me crazy. When I preview in Flash, everything looks fine. When I preview in HTML. Not so much. I've created a gallery using xml and have the code centering (and otherwise positioning) each new loaded item by referencing each ones information.

It seems to have trouble doing this with the first swf and positioning it at 0,0 after I click through the forward/back buttons that swf moves to a different location on the stage. My guess is that the loader height and width get calculated as 0,0 before the image gets loaded, and then screws everything up from there.

import fl.transitions.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.LoaderInfo;

[code]....

View 3 Replies

Professional :: Embed An Image / And Then Use That Image As Sprite?

Jan 27, 2012

Im quite new to actionscript and am in the process of making a simple platformer game. This is my first project and am still learning all the functions of actionscript.I am trying to embed an image, and then have a sprite have the appearance of that image ( I dont know how to word that any better...)[code]Im getting no errors, but the Sprite is still not showing the image i want it to.

View 1 Replies

Flash - Add Image Using Loader And Make Image A Button With Event Handler?

Oct 26, 2011

How would I make an image I load using AS3's loader class into a button with an event handler on it? Below is what I have started. And below that is my error I get when I click the message.

AS:

//call function that starts loading my image
callButtons();
function callButtons():void {

[code]....

the error I am getting when I click the spanish.png on the stage is: ArgumentError: Error #1063: Argument count mismatch on MyVideoPlayer_CS4_fla::MainTimeline/playSpanish(). Expected 0, got 1.I NEEDED TO ADDED evt:MouseEvent

View 1 Replies

Flash CS4 Loader Class: Image Loads Initially But Error Returned When Loading New Image

Mar 22, 2011

[code]This script is for a loader image gallery in flash, as part of a class assignment. What happens is that in flash, when I open the swf file, the initial image (images/nair_evanescentautumn.png) will load fine. However, clicking on any thumbnail image (including the exact same images/nair_evanescentautumn.png), will result in an error saying the file cannot be found.I cannot figure out why it is doing this... I've tested it over. Clicking each thumbnail does go to the correct position in the two separate functions. All said full-size image links are in the folder images/, and replacing the initial loader image will load the other images in place of the default one. However, clicking on any thumbnail still results in URL not found, even though everything works correctly.[code]Before anyone asks why I'm putting this kind of content into a flash site, I'm not--this is only for a class assignment. I'm just trying to figure out why my images aren't loading right when I'm only doing the exact same thing in the functions as I am on the other pages.Of note, commissions.swf has the exact same feature, just with swf files loaded instead, and it works perfectly fine. home, traditional, digital, and photography all have the image gallery, and all have the same issue (I only referenced one page because if I can fix one page I should be able to fix all of them).As for the artworks, they are all my fiance's. The website design was built for her, and I used the website design for this project because I didn't want to have to build an entirely new interface design. Since the project also required a gallery, I felt that this interface would work just fine.

View 3 Replies

ActionScript 3.0 :: XML Gallery Using Greensock Loader Class?

Jun 28, 2011

I am finding my way with AS3 but am having difficulty with a gallery project I am trying to put together based on the sample slideshow available on this site.

The problem relates to reading the thumb and image paths in the xml file. The error that is coming back is:

Loading error on ImageLoader 'loader1' (assets/thumbs/): Error #2035: URL Not Found. URL: file:///C|/Documents%20and%20Settings/Alistair.HOME/Desktop/AB%20gallery%20proj/assets/thumbs/

[Code].....

View 1 Replies

ActionScript 3.0 :: XML Gallery Sorting With Loader Class?

Sep 26, 2009

I'm reasonably new to AS3 having made the leap from Flash 8 to CS4 in a single bound. I've been doing okay, but I've stumbled across a bit of an issue:I'm using an XML file to load a gallery of images and information, where a node typically looks like this:

PHP Code:

 <project>  <image>1.jpg</image>   <link>gallery-1</link> - <title>- <![CDATA[ This is image number 1]]>   </title>- <info>- <![CDATA[ Lorem ipsum dolor sit amet, consectetaur adipisicing elit. ]]>   </info>  </project>- <project> 

In AS, once my XML has been parsed, it runs this function:

[AS]
var projectTitles:Array = new Array();
function createProjectClips(list:XMLList):void {

[code]....

This all works fine; I need all of these thumbs loaded and parsed at the same time to show the full gallery. The issue is that, as the images are of varying file sizes they don't load in sequence, and because I can't pass additional parameters through the eventListener, I've apparently got no way to organise the images on screen. So, my images on screen might be in the sequence 1.jpg, 4.jpg, 3.jpg, 2.jpg, but my projectTitles array will say Image 1, Image 2, Image 3, Image 4.

View 6 Replies

ActionScript 3.0 :: Adding A Pre Loader To An XML Photo Gallery Between The Photos?

Feb 15, 2010

I have made a photogallery in actionscript 3 which uses an .XML file to import pictures. As the user clicks on the displayed image the code loads the next image in the cycle into the display. Now, I would like to add a preloader which displays the loading progress of each image as the user clicks (otherwise there is just a blank area as the image loads). I have made a pre-loader for the main .SWF but I can't figure out how to make it work for the images or how to make a seperate one for the images. The fact is that I am a bit of a muppet when it comes to AS3, and am finding myself getting lost an confused quite easily.

I have attatched the .FLA if that helps any! If not then...

here is the link to the .HTML page that contains the .swf:

[Code]...

View 2 Replies

Flex :: Adding Loader Image While The Image Is Loading?

Feb 23, 2010

I need to create a gallery to load images and display them. This part is fine:

/**
* @variable image_name to store the name of the selected item
*/
private function showimage(evt:Event):void

[Code].....

where imgMain is the id the image component.

But, I need a small twist. A transition image i.e. loading image should be displayed while the the image is being loaded.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved