Video Tutorial-XML powered looping slideshow

Share your knowledge in a tutorial, or post code snippets and classes that might be useful to the community

Re:

Postby kschmiddy » Sat Apr 28, 2007 9:08 pm

Great! Looking forward to it!!

I've only managed MySQL databases, not created them...similar with PHP (have edited, but not written)...so maybe I'm out of my league on that...? Would love to start learning both though!

Would really appreciate your feedback on the photo portfolio I created (with your help): http://www.davidchristianphoto.com/portfolio.html

Any suggestions??
Best,
kschmiddy
kschmiddy
 
Posts: 34
Joined: Thu Sep 14, 2006 9:46 pm
Location: Edinburgh

Re: Video Tutorial-XML powered looping slideshow

Postby mattbing » Wed Dec 05, 2007 3:20 am

Thanks so much, great tutorial. And I was just about to ask how to have the images automatically loop and there was the answer right there! Again thanks.
mattbing
 
Posts: 6
Joined: Wed Dec 05, 2007 3:13 am

Re: Video Tutorial-XML powered looping slideshow

Postby Woocifer » Thu Dec 13, 2007 7:16 pm

Awesome tutorial! It's totally helping me out with my portfolio site... however I have a question. I've setup my site to use the Full Flash Site tutorial that Lee put up and have a main movie with all the content inside thats centering when the site loads.

However, and I'm not sure if this has any bearing on where the images are centering from, the slideshow seems to center the images inside the 'holder' container I've created to the top left corner of the image. I have the actionscript for the slideshow inside the 'mainmov' movie and that mainmov is placed on the root level of the flash file. The root level of the flash file has the actionscript that Lee showed in his tutorial for the Full Window Flash Site.

So essentially the top left corner(Transformation point) of the image is being put at the center point of the 'holder' and only showing up in the bottom 4th quadrant of the rectangle shape.

I tried to put the variable mainmov (which is the variable used to determine the size of the browser when it loads) into where holder is used here:

var centerX:Number = holder._width /2;
var centerY:Number = holder._height /2;
holder._x = (Stage.width / 2) - centerX;
holder._y = (Stage.height / 2) - centerY;

But it still ends up centering the image using the Transformation point being at the top left of the image. I tried commenting out those 4 lines and the create empty movie holder line but it still reverts to centering the image using the top left transformation point...

Any ideas on how to prevent this?
Woocifer
 
Posts: 14
Joined: Wed Dec 12, 2007 9:09 pm

Re: Video Tutorial-XML powered looping slideshow

Postby nebutch » Thu Dec 13, 2007 11:56 pm

Without seeing any code, my guess is that your holder isn't being placed correctly. Are you loading it externally or from the library? And can you post your current code?
Trust me, I know what I'm doing...

Image

Did this post help? If so, please consider a donation! Just click the "Donate" link at the top-right of this page.
User avatar
nebutch
Site Admin
 
Posts: 3417
Joined: Wed Apr 05, 2006 12:36 am
Location: Earth, Milky Way
Flash Version: Adobe Flash CS5.5
Authoring Environment: Other

Re: Video Tutorial-XML powered looping slideshow

Postby Woocifer » Fri Dec 14, 2007 12:45 am

Hey there,

Thanks for responding so quickly, I really appreciate it!!

Okay so I'm using this code in the root stage to create the Full Flash Browser:

import flash.display.BitmapData;

mainmov._x = Stage.width / 2;
mainmov._y = Stage.height / 2;

var tile:BitmapData = BitmapData.loadBitmap ("tile");

function fillBG () {
this.beginBitmapFill (tile);
this.moveTo (0,0);
this.lineTo (Stage.width,0);
this.lineTo (Stage.width,Stage.height);
this.lineTo (0,Stage.height);
this.lineTo (0,0);
this.endFill ();
}

fillBG ();

var stageL:Object = new Object ();
stageL.onResize = function () {
fillBG ();
mainmov._x = Stage.width / 2;
mainmov._y = Stage.height / 2;
}

Stage.addListener(stageL) ;


And then as a library object I have a rectangular movie clip called holder in the library that is placed within another movie clip called mainmov that centers in the root clip as you can see above.

The code I have on that 'holder' instance is this, from your tutorial:

#include "mc_tween2.as"

//this.createEmptyMovieClip("holder",100);
holder._alpha = 0;

var mcl:MovieClipLoader = new MovieClipLoader();

var mclL:Object = new Object();

mclL.onLoadInit = function() {
//var centerX:Number = holder._width /2;
//var centerY:Number = holder._height /2;
//holder._x = (Stage.width / 2) - centerX;
//holder._y = (Stage.height / 2) - centerY;
loadText.text = "";
holderIn();
imageNav();
}

mclL.onLoadProgress = function (target,bytesLoaded,bytesTotal) {
var loaded:Number = bytesLoaded;
var total:Number = bytesTotal;
var percent:Number = Math.round((loaded/total) * 100);
loadTxt.text = percent + "&";
if(percent<50) {
loadTxt._alpha = percent * 2;
} else if (percent >= 50) {
loadTxt._alpha = 200 - (percent * 2);
}
}

var xml:XML = new XML();
xml.ignoreWhite=true;

var whoIsOn:Number;
var images:Array = new Array();
var captions:Array = new Array();

xml.onLoad = function(success) {
if (success) {
var nodes = xml.firstChild.childNodes;
for (var i:Number = 0;i<nodes.length;i++){
images.push (nodes[i].attributes.src);
captions.push(nodes[i].attributes.caption);
}
}
whoIsOn = 0;
loadImage();
}

xml.load("images.xml");

function loadImage() {
mcl.loadClip(images[whoIsOn],holder);
mcl.addListener(mclL);
}

function holderIn() {
holder.alphaTo(100,1,"linear");
captionTxt.text = captions[whoIsOn];
}

function imageNav() {
holder.onRelease = function() {
captionTxt.text = "";
holder.alphaTo(0,1,"linear");
holder.onTweenComplete = function () {
if(whoIsOn == images.length - 1) {
whoIsOn = 0;
} else if(whoIsOn < images.length - 1) {
whoIsOn++;
}
loadImage();
}
}
}

I've commented out the certain lines of code that you, in a previous post, said to comment out when using a pre-existing instance in the library as the holder for the image loader.

Am I going nuts? screwing up with the code? A complete and utter noob? heh

I would appreciate any of your help.
Thanks bro!

Dennis
Woocifer
 
Posts: 14
Joined: Wed Dec 12, 2007 9:09 pm

Re: Video Tutorial-XML powered looping slideshow

Postby nebutch » Fri Dec 14, 2007 12:59 am

Looking at it quickly, I see that your "mainmov" clip is getting positioned to the center of the stage (or rather the registration point of the clip is).

Try changing these two lines:
Code: Select all
mainmov._x = Stage.width / 2;
mainmov._y = Stage.height / 2;

to this:
Code: Select all
mainmov._x = (Stage.width - mainmov._width) / 2;
mainmov._y = (Stage.height - mainmov._height) / 2;
Trust me, I know what I'm doing...

Image

Did this post help? If so, please consider a donation! Just click the "Donate" link at the top-right of this page.
User avatar
nebutch
Site Admin
 
Posts: 3417
Joined: Wed Apr 05, 2006 12:36 am
Location: Earth, Milky Way
Flash Version: Adobe Flash CS5.5
Authoring Environment: Other

Re: Video Tutorial-XML powered looping slideshow

Postby Woocifer » Fri Dec 14, 2007 1:50 am

Ya that's where I want the mainmov clip is right directly in the centre of whatever browser is opened. It's the code straight out of Lee's tutorial.
Woocifer
 
Posts: 14
Joined: Wed Dec 12, 2007 9:09 pm

Re: Video Tutorial-XML powered looping slideshow

Postby security » Thu Oct 07, 2010 1:48 am

[i][size=85]Hooola Amigos esta muy buena los tutoriales nesecito una ayuda hice unos cambios un tutorial de SlideShow para sacarle mas provecho pero no logré que al darle el click en la imagen me enlace a una url externa, aqui les mando los ActionScript y el xml:[/size][/i]

Hello Friends this very good tutorials nesecito aid a tutorial I made some changes of SlideShow to get more out but I could not get to give me click on the image link to an external url, here I send the ActionScript and xml:

[flash=]System.useCodepage = true;

var x:XML = new XML();
x.ignoreWhite = true;

var urls:Array = new Array();
var productos:Array = new Array();
var detalles:Array = new Array();
var precios:Array = new Array();
var codigos:Array = new Array();
var masgrandes:Array = new Array();
var grupo:Number;

//111111111111111111111111111111111111111111111111111
x.onLoad = function(success) {
var catalogo:Array = this.firstChild.childNodes;
for(i=0;i<catalogo.length;i++) {
urls.push(catalogo[i].attributes.url);
productos.push(catalogo[i].attributes.producto);
detalles.push(catalogo[i].attributes.detalle);
precios.push(catalogo[i].attributes.precio);
codigos.push(catalogo[i].attributes.codigo);
masgrandes.push(catalogo[i].attributes.masgrande);
}
imagen1.loadMovie(urls[0]);
producto1.text = productos[0];
detalle1.text = detalles[0];
precio1.text = precios[0];
codigo1.text = codigos[0];
masgrande1.htmlText = masgrandes[0];
grupo = 0;

imagen2.loadMovie(urls[1]);
producto2.text = productos[1];
detalle2.text = detalles[1];
precio2.text = precios[1];
codigo2.text = codigos[1];
masgrande2.htmlText = masgrandes[1];
grupo = 1;
};

x.load("cargardatos.xml");

antes.onRelease = function() {
if(grupo > 0) {
grupo--;
imagen1.loadMovie(urls[grupo]);
producto1.text = productos[grupo];
detalle1.text = detalles[grupo];
precio1.text = precios[grupo];
codigo1.text = codigos[grupo];
masgrande1.htmlText = masgrandes[grupo];

grupo--;
imagen2.loadMovie(urls[grupo]);
producto2.text = productos[grupo];
detalle2.text = detalles[grupo];
precio2.text = precios[grupo];
codigo2.text = codigos[grupo];
masgrande2.htmlText = masgrandes[grupo];
}
}

siguiente.onRelease = function() {
if(grupo < urls.length+1) {
grupo++;
imagen1.loadMovie(urls[grupo]);
producto1.text = productos[grupo];
detalle1.text = detalles[grupo];
precio1.text = precios[grupo];
codigo1.text = codigos[grupo];
masgrande1.text = masgrandes[grupo];

grupo++;
imagen2.loadMovie(urls[grupo]);
producto2.text = productos[grupo];
detalle2.text = detalles[grupo];
precio2.text = precios[grupo];
codigo2.text = codigos[grupo];
masgrande2.text = masgrandes[grupo];
}
}
[/flash]

[code]
<?xml version="1.0" standalone="iso-8859-1"?>

<datos>
<catalogo url="imagenes/ima-01.jpg "
producto="1-Placa Celeron AMD "
detalle="1MB de Cache + Sonido, Video y Red, 4 USB, Slot Impresora y mas "
precio="$ 75.00 "
codigo="LT-CEN-041 "
masgrande"Ver mas grande "
/>

<catalogo url="imagenes/ima-02.jpg "
producto="2-Placa Celeron AMD "
detalle="512 de Cache + Sonido, Video y Red, 4 USB, Slot Impresora y mas "
precio="$ 485.00 "
codigo="PL-AMD-041 "
masgrande="Ver mas grande "
/>
</datos>
[/code]
security
 
Posts: 1
Joined: Thu Oct 07, 2010 1:02 am
Flash Version: Adobe Flash CS4

Previous

Return to Shared User Content

Who is online

Users browsing this forum: No registered users and 1 guest