473,473 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

AS2 Photo Gallery size an action Issue

1 New Member
Hi there,

I'm a newbie with AS2....and i wanted to learn to create a photo gallery that scrolls right or left, and that when you click on the photo it becomes bigger.
Well I found a tutorial from a site. The only thing is that... when I built it and applied it to my project it does not work:
The issue is that it takes over the main page, even though is in its own swf file....(It's part of a flash website, where each page is loaded separately...in this case this AS is in one page (portfolio) and when it gets loaded in the main page...the AS acts upon the "root"...I really don't know how to change the script to only act upon the native swf file. I'm using a loader component to load the external pages...not sure if this is what's causing the issue? :roll:
Also, aside from all the photos appearing across the entire horizontal part of the page(they do get to scroll), but when you click on the photo ..it does enlarge but it freezes the whole page. I would like for this action to only be constrain to the size of the page, which is a different size than the one of main page, and to be able to be clickable...I know this might sound confusing... but if anyone can help I can supply a url...to explain things better! In the mean time here is the code....
Expand|Select|Wrap|Line Numbers
  1.  
  2. import mx.transitions.Tween;
  3. import mx.transitions.easing.*;
  4.  
  5. this.createEmptyMovieClip("container",1);
  6. var imagesNumber:Number = 39;
  7. var scrolling:Boolean = true;
  8.  
  9. for (i=1; i<=imagesNumber; i++) {
  10.     container.attachMovie("thumb"+i,"thumb"+i+"_mc",i);
  11.     myThumb_mc = container["thumb"+i+"_mc"];
  12.     myThumb_mc._x = (i-1)*myThumb_mc._width;
  13.     myThumb_mc._y = (Stage.height-myThumb_mc._height)/2;
  14.     myThumb_mc._alpha = 50;
  15.     myThumb_mc.largerImage = i;
  16.     myThumb_mc.onRollOver = function() {
  17.         this._alpha = 100;
  18.     };
  19.     myThumb_mc.onRollOut = function() {
  20.         this._alpha = 50;
  21.     };
  22.     myThumb_mc.onRelease = function() {
  23.         this._alpha = 50;
  24.         for (i=1; i<=imagesNumber; i++) {
  25.             var myClip = container["thumb"+i+"_mc"];
  26.             myClip.enabled = false;
  27.         }
  28.         scrolling = false;
  29.         _root.attachMovie("image"+this.largerImage,"large_mc",2);
  30.         large_mc._x = (Stage.width-large_mc._width)/2;
  31.         large_mc._y = (Stage.height-large_mc._height)/2;
  32.         new Tween(large_mc, "_alpha", Strong.easeOut, 0, 100, 0.5, true);
  33.         new Tween(container, "_alpha", Strong.easeOut, 100, 50, 0.5, true);
  34.         large_mc.onRelease = function() {
  35.             this.enabled = false;
  36.             scrolling = true;
  37.             var myFadeOut = new Tween(large_mc, "_alpha", Strong.easeOut, 100, 0, 0.5, true);
  38.             new Tween(container, "_alpha", Strong.easeOut, 50, 100, 0.5, true);
  39.             myFadeOut.onMotionFinished = function() {
  40.                 for (i=1; i<=imagesNumber; i++) {
  41.                     var myClip = container["thumb"+i+"_mc"];
  42.                     myClip.enabled = true;
  43.                 }
  44.                 large_mc.removeMovieClip();
  45.             };
  46.         };
  47.     };
  48. }
  49. container.onEnterFrame = function() {
  50.     if (scrolling) {
  51.         this._x += Math.cos((-_root._xmouse/Stage.width)*Math.PI)*15;
  52.         if (this._x>0) {
  53.             this._x = 0;
  54.         }
  55.         if (-this._x>(this._width-Stage.width)) {
  56.             this._x = -(this._width-Stage.width);
  57.         }
  58.     }
  59. };
Please help...I would be greatly appreciative!!!
Thanks in advance!
Sue
Aug 28 '08 #1
0 2184

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: matt | last post by:
I have this code, works perfectly on Windows server, but now i'm trying to run it on a Linux server, the form submits, i get no errors, but the photo doesnt upload, and the caption file doesnt...
1
by: leigh | last post by:
I need a php photo gallery script that will allow me to categorise photos to directories/sections, post captions for each photo and allow users to comment on individual photos. If there is one...
3
by: bob garbados | last post by:
I'm looking for thoughts on photo galleries and security/performance implications... I'm working on an asp.net site in vb that will include an updateable photo gallery that will display thumbnails...
1
by: desjardins.daniel | last post by:
Hi ! Excuse my english, i'm a french canadien... So here my message : I have put on my site a photo gallery and at the right a nav menu. This menu has a red dot visible want someone is passing...
13
by: Viken Karaguesian | last post by:
Hello everyone, Can anyone recommend a good online site to learn PHP? The W3Schools website is quite lacking - leaves much to be desired. I'm sure there are many places, but which ones are good?...
1
by: Xah Lee | last post by:
The following is a program to generate thumbnail images for a website. Useful, if you want to do that. It is used to generate the thumbnails for my “Banners, Damsels, and Mores” project...
11
by: shror | last post by:
hi every body I need help please i have designed an image gallery of about 20 pictures and they are shown in thumb nail views and for viewing the largeer version of the images i have added a...
1
by: cumupkid | last post by:
II am trying to create a form that will allow me to upload photos to a folder in the site root directory and add the information to the mysql db at the same time. I have created two forms, one...
3
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.