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.
|
|
|
|
|
![]() |
||
Needs big help in Action Script 2
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
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; } } } |
|
|
|
#2
|
|||
|
|||
|
Re: Needs big help in Action Script 2
Seems like it is working within your sample website. Did you already fix the problem?
|
|
#3
|
|||
|
|||
|
Hmm! Nop I didn’t fix the problem up till now Do you have any idea for fix this problem? |
|
#4
|
|||
|
|||
|
Re: Needs big help in Action Script 2
The stage changes size currently for the pictures. Maybe I am missing something....
|
|
#5
|
|||
|
|||
|
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!! |
|
#6
|
|||
|
|||
|
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?
|
|
#7
|
|||
|
|||
|
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. |
|
#8
|
|||
|
|||
|
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?
|
|
#9
|
|||
|
|||
|
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?
|
|
#10
|
|||
|
|||
|
Re: Needs big help in Action Script 2
thanks!!
|
|
#11
|
|||
|
|||
|
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.
|
|
#12
|
|||
|
|||
|
Re: Needs big help in Action Script 2
ahh! thank you very!!very!!verymuch!! thats's a very big help for me!
|
|
#13
|
|||
|
|||
|
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!!
|
|
#14
|
|||
|
|||
|
Re: Needs big help in Action Script 2
thanks!!! sir
|
|
#15
|
|||
|
|||
|
Re: Needs big help in Action Script 2
Your Welcome...
|
![]() |
| Tags |
| customized photo gallery |
| Thread Tools | |
|
|
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 |