Needs big help in Action Script 2

This is a discussion on "Needs big help in Action Script 2" within the Flash & Multimedia Forum section. This forum, and the thread "Needs big help in Action Script 2 are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Oct 27th, 2006, 11:35
New Member
Join Date: Oct 2006
Location: sri lanka
Age: 25
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Needs big help in Action Script 2

Hi to all! I am new to this forum. I faced a big challenge in my class project. I used Flash 8 to finish this project.

The biggest challenge is customized photo gallery and needs to have large photos be shown, and then have to be able to auto resize depending on the dimensions of the .JPG photo file. It will need to read an external file folder and display the photos in that order and also the size of each .JPG file ( I used XML code for that). Transition between pictures (manually moving to then next photo or timed between transitions). Again, the need for the photos to be drawn from an external directory and auto resize is a must. But the font, buttons and logo should remain the same.

I have Sample site call www.whispersphotography.com. I tried with below coding, unfortunately I will unable to come up with the right script. Appreciate if someone can modify below script to meet above requirement. Thank you.


fscommand("allowscale", "false");
Stage.scaleMode = "noScale";

targetPhoto._visible = false;

slides_xml = new XML();
slides_xml.onLoad = loadSlideShow;
slides_xml.load("album.xml");
slides_xml.ignoreWhite = true;

function loadSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
currentSlideNode = rootNode.firstChild;
photos = new Array(totalSlides);
thumbs = new Array(totalSlides);
captions = new Array(totalSlides);
tx = 0;
for (i=0; i < totalSlides; i++) { // populate arrays and create thumbnails dynamically
photos[i] = currentSlideNode.attributes.jpegURL;
thumbs[i] = [currentSlideNode.attributes.jpegWidth,currentSlide Node.attributes.jpegHeight];
captions[i] = currentSlideNode.firstChild.nodeValue;
_root.attachMovie("thumb","thumb"+i,i);
_root["thumb"+i]._x = tx;
_root["thumb"+i]._y = 595; // using fixed Y coord
_root["thumb"+i].tindex = i;
tx += 22;
currentSlideNode = currentSlideNode.nextSibling;
}
// initialize values
currentIndex = 0;
targetWidth=thumbs[currentIndex][0]; // get width
targetHeight=thumbs[currentIndex][1]; // get height;
updateSlide();
}
}

function updateSlide() { // load photo, update caption and status fields
targetPhoto.loadPhoto(photos[currentIndex]);
caption = captions[currentIndex];
statusField = (currentIndex+1) + "/" + totalSlides;
}

function slideShow() {
if (currentIndex == totalSlides-1) { currentIndex = 0; } else { currentIndex++; }
targetPhoto._visible = false;
targetWidth=thumbs[currentIndex][0]; // get width
targetHeight=thumbs[currentIndex][1]; // get height;
updateSlide();
}

MovieClip.prototype.loadPhoto = function(fn) { // load external jpeg method + preloader
this.createEmptyMovieClip("holder", 1);
this.holder.loadMovie(fn);
this.onEnterFrame = function() { // NOTE: could use this to display percentage to user
if (Math.floor((this.holder.getBytesLoaded()/this.holder.getBytesTotal())*100) >= 100) {
delete this.onEnterFrame;
}
}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Oct 28th, 2006, 19:33
Elite Veteran
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Needs big help in Action Script 2

Seems like it is working within your sample website. Did you already fix the problem?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 30th, 2006, 06:58
New Member
Join Date: Oct 2006
Location: sri lanka
Age: 25
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Re: Needs big help in Action Script 2

Sorry for not responding you!!
Hmm! Nop I didn’t fix the problem up till now

Do you have any idea for fix this problem?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Oct 30th, 2006, 14:09
Elite Veteran
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Needs big help in Action Script 2

The stage changes size currently for the pictures. Maybe I am missing something....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Oct 31st, 2006, 09:58
New Member
Join Date: Oct 2006
Location: sri lanka
Age: 25
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Re: Needs big help in Action Script 2

ahh! i can attach all the files that I have. I try some changes in as2 codes but it didn’t comes up with what I want!

thanks!!
Attached Files
File Type: zip image_album.zip (104.6 KB, 39 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Nov 1st, 2006, 02:10
Elite Veteran
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Needs big help in Action Script 2

Seems like you have the file resizing, what is the problem, what is not working. What is this supposed to be doing?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Nov 1st, 2006, 05:57
New Member
Join Date: Oct 2006
Location: sri lanka
Age: 25
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Needs big help in Action Script 2

Thank you very much for replying me to sort-out this problem!

Ok! When the image is loaded the image background (the gray color background) is resizing according to the image like www.whispersphotography.com (it’s has to be resize without buttons and other stuff on the movie), But in my movie the whole movie is resizing according to the image.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Nov 1st, 2006, 14:27
Elite Veteran
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Needs big help in Action Script 2

Ok, www.whispersphotography.com is not your website?? Ok in the whisper photography website, it looks like they are just doing a motion tween, which resizes to the size of the picture...Why don't you just do that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Nov 1st, 2006, 14:59
New Member
Join Date: Oct 2006
Location: sri lanka
Age: 25
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Re: Needs big help in Action Script 2

Yes www.whispersphotography.com is not my web site. My project task is develop a image gallery similar to that. But I download whisper SWF and decompiled it as a FLA. I note some my AS codes similar to whisper site. Ok! How they give motion tween for images? Do I have to edit images manually for giving motion tween?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Nov 1st, 2006, 15:01
New Member
Join Date: Oct 2006
Location: sri lanka
Age: 25
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Needs big help in Action Script 2

thanks!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Nov 1st, 2006, 15:05
Elite Veteran
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Needs big help in Action Script 2

Are you saying you don't know how to apply a motion tween to an image? I will make you a sample file when I get home. You just want to take and make a movie clip, and have that movie clip cycle though some pictures, this effect can be achieved via a motion tween. Don't do stop actions and you won't have to worry about using buttons.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Nov 1st, 2006, 15:39
New Member
Join Date: Oct 2006
Location: sri lanka
Age: 25
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Needs big help in Action Script 2

ahh! thank you very!!very!!verymuch!! thats's a very big help for me!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Nov 2nd, 2006, 00:15
Elite Veteran
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Needs big help in Action Script 2

Sorry I don't have time to upload a file but it is pretty simple just a basic motion tween, that changes from picture to picture, and that's about it. Sorry I could not help...Good Luck, let me know if you have any other questions!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Nov 2nd, 2006, 06:40
New Member
Join Date: Oct 2006
Location: sri lanka
Age: 25
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Needs big help in Action Script 2

thanks!!! sir
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Nov 2nd, 2006, 19:10
Elite Veteran
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Needs big help in Action Script 2

Your Welcome...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
customized photo gallery

Thread Tools

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to change button action into a movieclip button action cjrollo Flash & Multimedia Forum 7 Nov 21st, 2007 18:07
BUTTON will not take an action script griffonwing Flash & Multimedia Forum 2 Jun 8th, 2007 12:33
Problem with Action Script shaza2007 Flash & Multimedia Forum 4 Apr 5th, 2007 19:01
Help with the following action. mrmag2000 Web Page Design 3 Jul 8th, 2005 12:26
Action Script Help courtjester Flash & Multimedia Forum 1 Sep 8th, 2003 06:49


All times are GMT. The time now is 10:26.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved