473,788 Members | 2,694 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HorizontalList of images from dynamic source

63 New Member
Hi Everyone,

As usual, after trying what I can, I come here to ask for your help.

Once I found out that scrollToIndex was not working in Flash, but it was working within Flex, then I started to learn Flex, so I'm a newbie.

I am trying to load an xml file into flex to populate a HorizontalList of images.

I am able to populate a datagrid using the same logic with no problem, but I have yet to be able to populate the HorizontalList, and the weird thing is that, I receive no errors during compile time. When I view the app in the browser, everything looks great except within the HorizontalList, all it displays is some text "Image10" -- what???

Here's the code:
Expand|Select|Wrap|Line Numbers
  1.     <mx:XML id="tempImageXML" source="http://www.mydomain.com/image_readerH.xml" />
  2.     <mx:XMLListCollection id="cuePointImageXMLList" source="{tempImageXML.row}" /> 
  3.  
  4.  
  5.     <mx:HorizontalList width="100%" height="100">
  6.  
  7.                     <mx:Image source="@Embed('http://www.mydomain.com/images/' +String({cuePointImageXMLList}))" width="50" height="50" />
  8.  
  9.     </mx:HorizontalList>
  10.  
Thanks in advance,
Tarik (Tah-Rick)
Nov 5 '07 #1
1 5655
Tarik Monem
63 New Member
OK, so I've changed the flex code to load an .swf file which can load pictures, but I'm having a hard time loading pics after the initial 25 jpegs load.

Expand|Select|Wrap|Line Numbers
  1.     <mx:VBox>
  2.         <mx:SWFLoader id="Load" source="@Embed(source='readfromdir4.swf')" height="150" width="100%"/>
  3.     </mx:VBox>
  4.  
I'm trying not to load all 6,000 images into the browser's at once, so I'm trying to do it 25 at a time.

Here's how I get the first 25:

Expand|Select|Wrap|Line Numbers
  1.  
  2. var filepath:String;
  3.  
  4. if (_url.indexOf("http") != 0) filepath = "http://www.mydomain/server/";
  5. else filepath = "";
  6.  
  7. var lv:LoadVars = new LoadVars();
  8. var pics:Array = [];
  9. var mcl:MovieClipLoader;
  10. var ipic:Number;                    // index into pics, used during loading
  11.  
  12.  
  13. // function to read returned list and push items into pics array
  14. function fillPicsArray(ok) {
  15.     if (ok) {
  16.         for(i=0;i<6000;i++)
  17.         {
  18.             pics.push(this["f"+i]);
  19.         }
  20. //        trace('the directory has ' + pics.length + ' pictures');
  21.         k=0;
  22.         for(j=myPrevNumber;j<myNextNumber;j++)
  23.         {
  24.             tempPics[k] = pics[j];
  25.             k++;
  26.         }
  27.         loadPic();
  28.     } else {
  29.         trace("problem with the script");
  30.     }
  31. }
  32.  
  33. // function to execute when each picture is loaded
  34. function onLoadInit(pic:MovieClip) {
  35.     pic._width = 50;
  36.     pic._height = 50;
  37.     pic._x = 8 + 66*ipic;
  38.     pic._y = 10;
  39.     pic._alpha = 100;
  40.     pic.filters = [picShadow];
  41.     if (++ipic < tempPics.length) loadPic();
  42. }
  43.  
  44. // function that loads one pic (as pointed to in the pics array by ipic)
  45. function loadPic() {
  46.     holder.createEmptyMovieClip("p"+ipic,ipic);
  47.     holder["p"+ipic]._alpha = 0;
  48.     mcl.loadClip("http://www.mydomain.com/images/" + tempPics[ipic], holder["p"+ipic]);
  49. }
  50.  
  51.  
That's fine, but I have tried all kinds of ways to try and load the next 25 images, but to no avail.

I know the values are there and I know that it is incrementing correctly, because I am placing the values into a textarea after I've clicked on the "Next 25" button. Here's the code for the next 25.

Expand|Select|Wrap|Line Numbers
  1.  
  2. var mcl2:MovieClipLoader = new MovieClipLoader();
  3. var ml:Object = new Object();
  4. ml.onLoadInit = function(target_mc:MovieClip) 
  5. {
  6.     target_mc._width = 50;
  7.     target_mc._height = 50;
  8.     target_mc._x = 8 + 66*ipic;
  9.     target_mc._y = 10;
  10.     target_mc._alpha = 100;
  11.     target_mc.filters = [picShadow];
  12. }
  13.  
  14.  
  15.  
  16.  
  17. myNext25btn.onRelease = function()
  18. {
  19.     this.createEmptyMovieClip("holder2", 1);
  20.     myPrevNumber += 25;
  21.     myNextNumber += 25;
  22.         k=0;
  23.         for(j=myPrevNumber;j<myNextNumber;j++)
  24.         {
  25.             tempPics[k] = pics[j];
  26.             msg_ta.text += tempPics[k];
  27.             mcl.loadClip("http://www.mydomain.com/images/" + tempPics[k], ml["p"+k]);
  28.             k++;
  29.         }
  30.         msg_ta.text += myNextNumber;
  31. }
  32.  
  33. myPrev25btn.onRelease = function()
  34. {
  35.     this.createEmptyMovieClip("holder", 2);
  36.     myPrevNumber -= 25;
  37.     myNextNumber -= 25;
  38.     fillPicsArray;
  39. }
  40.  
  41. function loadPic2(k)
  42. {
  43.     holder2.createEmptyMovieClip("p"+k,k);
  44.     holder2["p"+k]._alpha = 0;
  45.     mcl.loadClip("http://www.mydomain.com/images/" + tempPics[k], holder2["p"+k]);
  46. }
  47.  
  48.  
Thanks in advance :-)
Nov 6 '07 #2

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

Similar topics

0
2645
by: Henk Verhoeven | last post by:
(Reply on this newsgroup to an email - reply by email did not work) Wolfman wrote: > > Hi, > I found your Email in the php Newsgroup. > I was looking for some way to resize some graphiks on my HP , to fit the actual Browser size. So I found this: > > <HTML><HEAD></HEAD>
5
2380
by: K | last post by:
I have found a script online that I want to use (I am new to PHP). It creates dynamic images based on the text that you pass it. However, no matter how I try, I can't get anything other than a blank white image. Can one of you knowledgeable people please have a look at the code below and help please.
7
1516
by: duncan.lovett | last post by:
I want to generate dynamic heading images, but I won't be able to use the GD Library, ImageMagick or any other plug-in to generate an image on the fly due to hosting restrictions. I have seen, in the past, sites that generate headings from a set of Gif images, each corresponding to a letter in the string that is being turned into a graphical heading. I've searched in vain on a technique on how to do this, but all I can find is the GD...
1
4483
by: Chris Nafziger | last post by:
In my code to send email from VBScript, I use standard CDOSYS code similar to the following: With oMsg Set .Configuration = oCon .To = """Admin"" <admin@mycompany.com>" .From = """Joe Admin"" <jadmin@mycompany.com>" .Subject = "Hey You!" .TextBody = "Service(s) have failed!" .Send
2
1745
by: Tim | last post by:
I have an asp.net application that generates dynamic images (charts). When I run the application in debug mode from visual studio, or refer to the url with localhost in the name, everything works fine. When I try to access the site with the full machine name (not using localhost), or from another machine, the dynamic images only appear as red x's. I've searched the groups, but can't find anything that seams to relate. I am assuming this...
8
2454
by: Chris Beall | last post by:
I'm struggling with how to handle, on a web page, images that contain text that the user must be able to read. Examples: tombstone photos, photos or scans of historic documents (handwritten or typed), a map with place names, route numbers, etc. (An appropriate alternative for audio UAs would be provided and is not a part of my concern). I see two ways to handle these images: 1. Dynamic scaling, with the source image containing enough...
5
7863
by: Glen Richards | last post by:
I've had no success in trying to dynamically set images at runtime in a Crystal Reports 9 report using C# 2005 Beta. I've been doing research along these lines & all the posts I've read say this can't be done. I was wondering if I've missed anything or if Crystal Reports 10 has added this feature? I downloaded a sample VB6 project (cr9_vb_rdc_loadpic.exe) from
2
1568
by: boeledi | last post by:
Hello, I am developing in ASP.NET 1.1 (and unfortunately I am obliged to use 1.1). I need to generate images, using GDI+ and retrieve them on the web page, using AJAX. On the server side, I have a ASPX page that generates the bitmap and has to return it, when invoked by the client, via AJAX (XMLHTTP). Here
1
2704
by: richardgroen | last post by:
Hi all, I got one brainteaser (well...for me). I have a database with, lets say 100 images, these images are 'dynamic' e.g. it can be 100 but also 151 images. My question is: How can i make a dynamic table where I can set that the maximum columns is 5. So when parsing the images, then CF fills up a row of 5 images (all in a different column) and the 6th is at a new row etc. etc. I just cant figure it out.
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10370
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10113
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7519
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4074
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 we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2896
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.