...

View Full Version : Help with Flickr Flex Widget!



nittanylion88
11-11-2009, 08:26 PM
Hi, all! I am new to Flex (currently a college student) and found a tutorial on building a Flickr widget with flex at this address: http://articles.sitepoint.com/article/funky-flickr-flex-widgets/1



I have downloaded Adobe Flex Builder 3 and am working on the first part of the tutorial.



I put this exact same code (http://www.sitepoint.com/examples/flex-flickrtag/flickrtag1.txt) into Flex Builder and substitute my personal API key and this is what I get: (see image).



Any ideas as to what I am doing wrong? I feel like I am one step away from getting this right!

http://www.personal.psu.edu/heh5003/widget_test.bmp

I really appreciate your help! :o

Inigoesdr
11-12-2009, 06:26 PM
First of all, convert that image (http://www.media-convert.com/) to a more reasonable format. 1.3MB for that screenshot is ridiculous.

Then, to find out what's going on setup a few debug messages to let you know of the status of the request. For example:

import mx.controls.Alert;
private function onFlickrResult( event:ResultEvent ) : void {
Alert.show('got a result');
for each( var photo:XML in event.result..photo ) {
var smallPhotoUrl:String = 'http://static.flickr.com/'+photo.@server+'/'+photo.@id+'_'+photo.@secret+'_s.jpg';
var bigPhotoUrl:String = 'http://static.flickr.com/'+photo.@server+'/'+photo.@id+'_'+photo.@secret+'.jpg';
images.push( {
source:smallPhotoUrl,
bigSource:bigPhotoUrl,
title:photo.@title,
latitude:photo.@latitude,
longitude:photo.@longitude
} );
}
setPictures();
}

public function faultHandler(event:FaultEvent):void
{
Alert.show(event.fault.faultString);
}
Then set the "fault" attribute in the HTTPService tag:

<mx:HTTPService id="flickrSearch" resultFormat="e4x" result="onFlickrResult(event)" fault="faultHandler(event)" />



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum