473,387 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Actionscript problem with dynamic image portfolio

I'm working on a flash portfolio that loads examples of our work (jpgs) into a movie.

For example, it started off using an xml list to display certain images but I found it necessary to draw info from the database and pass some variables in the querystring to change the source of the images in the movie depending on which client is clicked.

Here is the problem.

I have tweaked the code and it should work fine - and sometimes it does. But in the case where client A has 3 projects, sometimes it displays the 3 different images, or sometime it displays just the last image 3 times. When all 3 are the same, sometimes I see that it loads all 3 images but then it's quickly overwritten with the last image.


The URL for this is at : http://12.162.169.138/clients.php?client=29

The URL for the actual SWF is http://12.162.169.138/portfolio4.swf?client=29&pic=10&pic=33&pic=36

-----------------------------------------------------------------

Here is the code that puts the pictures into the movie :

Expand|Select|Wrap|Line Numbers
  1. onClipEvent (load) {
  2.       ogy = _y;
  3.       //if (thenum>0) {
  4.       thurl = this._url;
  5.       var fulllist = thurl;
  6.       //thurl = _parent.toadd+lurl;
  7.       var picarr = thurl.split("&pic=");
  8.       alen = picarr.length;
  9.       for (var i = 1; i<alen; i++) {
  10.             loadMovie(toadd+"pics/"+picarr[i]+".jpg", pic.pic2);
  11.       }
  12.       //loadMovie(toadd+"pics/"+_parent.specs.attributes.name+".jpg", pic.pic2);
  13.       //}
  14. }
  15.  
  16. onClipEvent (enterFrame) {
  17.       if (_parent.nav == thenum) {
  18.             gotoy = _parent.stageheight/2-34;
  19.             if (!done) {
  20.                   gotor = random(30)-random(30);
  21.                   done = true;
  22.             }
  23.       } else if (_parent.nav>thenum) {
  24.             done = false;
  25.             gotoy = -500;
  26.       } else if (_parent.nav<thenum && _parent.nav != 0) {
  27.             gotoy = _parent.stageheight+500;
  28.             done = false;
  29.       } else {
  30.             gotoy = -600;
  31.             done = false;
  32.       }
  33.       lefty = gotoy-_y;
  34.       _y += lefty/4;
  35.       leftr = gotor-_rotation;
  36.       //_rotation += leftr/4;
  37. }
  38. onClipEvent (mouseUp) {
  39.       //lurl=_parent.lurl;
  40.       lurl = _parent.toadd+lurl;
  41.       //getURL("pics/"+thenum+"d.jpg", "detail");
  42.       getURL(lurl, "detail");
  43. }
  44.  

-----------------------------------------------------------------

Here is the code that makes the side menu :

Expand|Select|Wrap|Line Numbers
  1. stop();
  2. nav=1;
  3. stageheight = 300;
  4. toadd = "";
  5. menuxml = new XML();
  6.  
  7. myURL = this._url;
  8. var picarr = myURL.split("&pic=");
  9.  
  10. //myPos = myURL.lastIndexOf("?");
  11. //client = myURL.substring(myPos,myURL.length);
  12. //this returns the querystring elements - you can now split these using split
  13. var client1 = picarr[0];
  14. var clientarr = client1.split("=");
  15. var client = clientarr[1];
  16.  
  17. menuxml.load(toadd+"xml/"+client+".xml");
  18. menuxml.ignoreWhite = true;
  19. menuxml.onLoad = function(success) {
  20.       if (success) {
  21.             maxnum = menuxml.firstChild.childNodes.length;
  22.             for (n=0; n<maxnum; n++) {
  23.                   specs = menuxml.firstChild.childNodes[n];
  24.                   //menu
  25.                   duplicateMovieClip(clip0, "clip"+(n+1), n);
  26.                   menuclip = eval("clip"+(n+1));
  27.                   menuclip.h = stageheight/maxnum;
  28.                   menuclip._y = 20*n;
  29.                   menuclip.thetitle = specs.attributes.name;
  30.                   menuclip.thecaption = specs.attributes.caption;
  31.                   menuclip.theurl = specs.attributes.url;
  32.                   //menuclip.thetarget = specs.attributes.target;
  33.                   menuclip.thenum = n+1;
  34.                   //pic
  35.                   duplicateMovieClip(pic0, "pic"+(n+1), n+100);
  36.                   picclip = eval("pic"+(n+1));
  37.                   //picclip = eval("pic"+specs.attributes.name);
  38.  
  39.                   //picclip.thetitle = specs.attributes.name;
  40.                   //picclip.thecaption = specs.attributes.caption;
  41.                   picclip.lurl = specs.attributes.url;
  42.                   picclip.thenum = n+1;
  43.                   play();
  44.             }
  45.             clip0._visible = false;
  46.             pic0._visible = false;
  47.       }
  48. };
  49.  
  50.  
-------------------------------------------------------------------

I've tried also changing the following code in the code that's attached to the actual pic movie.

Expand|Select|Wrap|Line Numbers
  1. for (var i = 1; i < alen; i++) {
  2.             loadMovie(toadd+"pics/"+picarr[i]+".jpg", pic.pic2);
  3.       }
  4.  
becomes

Expand|Select|Wrap|Line Numbers
  1.  oadMovie(toadd+"pics/"+picarr[1]+".jpg", pic.pic2);
  2.  
  3.       for (var i = 2; i < alen; i++) {
  4.             duplicateMovieClip(pic, "pic"+i, i);
  5.             eval("pic"+i).loadMovie(toadd+"pics/"+picarr[i]+".jpg", i);
  6.  
  7.       }
  8.  
But that doesn't help either.. that just means that the first image repeats 3 times instead of the last image.
Jul 13 '07 #1
0 2106

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

Similar topics

0
by: Celine | last post by:
I'm using a datalist to display images from a database. I'm using ImageButton within it to display each pictures.Everything is working fine. I need to know now how to get the name of each of the...
0
by: jitu78 | last post by:
Hi, I am using iframe to load dynamic content so that whole page not refresh at the time of click. Here is link, globtier.com/portfolio/index.php But in OPERA browser, it is showing white...
2
by: jitu78 | last post by:
Hi All, I am having problem with Pixel fonts in Flash. When I am using pixel fonts for dynamic contents, textual data is looking blurry. They are showing right with static content. That’s...
7
by: eholz1 | last post by:
Hello Group, Perhaps you can help me. I have a mysql db, that holds images. Images are encoded using base64_decode/encode, etc. Image data seems fine. I have a view.php page that is supposed...
38
by: Tom | last post by:
I need my data generating C program on computer #1 to export small amounts of data (one - 40 byte data structure) periodically (once per minute) to a C program on computer #2. I am considering...
3
by: paolazi | last post by:
Hello I have a problem: I have a database(mysql) with the following fields: test, descr, title I want to display them into a flash file. Now my php file called list.php (which collect the...
1
by: cyra | last post by:
Hi guys, this is the first time I post in our forum, I would like to say thanks to whom reading this. I'm new to ASv3 and in stuck of dealing with a problem like this : I have some .fla file...
1
anfetienne
by: anfetienne | last post by:
i have this code below that i made....it loads vars from txt file splits it then puts it into an array....once in an array it the brings the pics in from the array to create thumbnails and a larger...
1
by: mlm1975 | last post by:
1. I have a XML file for a portfolio. Each "project" in the portfolio contains elements: project title, project date, project location and project image. 2. I have loaded the XML file into the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.