Talk:Flex Framework:samples:photodemo
From Adobe Labs
If you intend to edit the 'Discussion' tab of this document, you must sign your comment. To do so, simply add four tilde characters as so:
~~~~
...on a new line at the end of your post to add your username and timestamp to the comment. Anonymous or off-topic comments will be removed by the Labs wiki administrators at their discretion.
| Table of contents |
|
1 Correct code for the Photo Demo site |
Video Problem
Is anyone else experiencing problems where the video stops playing about halfway through?
sixside 13:27, 16 Nov 2005 (PDT)
Permissions
Hmm, should I really have permisions to create content on this site?
Dantrey 11:15, 28 Oct 2005 (PDT)
RE: Permissions
In many cases, yes- but in this case I've protected this page until the author decides to unlock it. Thx for the heads-up!
sfegette 09:59, 27 Oct 2005 (PDT)
Correct code for the Photo Demo site
The code for the Flickr app seems to be using old tags.
Here is the code that I corrected to work on Flex Builder 2 Beta 1
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*">
<mx:HTTPService id="service" url="http://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=*** Flickr Key goes here ***&per_page=12&tags={input.text}" />
<mx:states>
<mx:State name="results">
<mx:SetProperty target="{panel1}" property="width" value="100%"/>
<mx:SetProperty target="{panel1}" property="height" value="100%"/>
<mx:AddChild target="{canvas1}" position="lastChild">
<mx:TileList dataProvider="{service.result.rsp.photos.photo}" listItemRenderer="Thumbnail">
<mx:layoutConstraints>
<mx:Anchor top="30" right="4" bottom="3" left="4"/>
</mx:layoutConstraints>
</mx:TileList>
</mx:AddChild>
</mx:State>
</mx:states>
<mx:Panel height="66" width="302" title="Photos" id="panel1" resizeEffect="Resize">
<mx:Canvas height="100%" width="100%" id="canvas1">
<mx:Label x="3" y="5" text="Tags"/>
<mx:TextInput x="42" y="3" id="input"/>
<mx:Button x="209" y="3" label="Find" click="currentState='results'; service.send()"/>
</mx:Canvas>
</mx:Panel>
</mx:Application>
IndyNagpal 19:42, 9 Mar 2006 (PST)
This didn't work in the Flex 2.0 beta 2.. hScroll and vSscrollpolicy didn't work, but moreover, I get a pile of "Access of undefined property 'dataObject'" from the Thumbail.mxml compilation. Looks like whatever the XML feed spools to doesn't label the objects dataObject. Any clues on how to use the debugger correctly to identify what these are now called? (IE: teach a man to fish :)
ereedstrom http://www.BrokeHouse.com
Here's the updated code for Beta 2:
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" width="300" height="150" horizontalScrollPolicy="off" verticalScrollPolicy="off" borderStyle="none">
<mx:Fade id="fade" target="{this}"/>
<mx:Image id="img" source="http://static.flickr.com/{data.server}/{data.id}_{data.secret}.jpg" complete="fade.playEffect()" />
</mx:VBox>
Hope it helps...
Thanks for the video guys.
Trouble I have is i watched it, tried to do what the instructor was doing and he had bits of code that appeared without him describing where it had come from.
Also add the fact that i kept on getting code errors, it is such a good idea to show this video when the code doesn't work with the release of flex most of us have?
It kind of confuses beginners like myself.
Updated code for the Photo Demo site to Flex 2 Beta 3
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:HTTPService showBusyCursor="true" id="service" url="http://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=****&tags={input.text}&per_page=20" />
<mx:states>
<mx:State name="results">
<mx:SetProperty target="{panel1}" name="width" value="100%"/>
<mx:SetProperty target="{panel1}" name="height" value="100%"/>
<mx:AddChild relativeTo="{panel1}" position="lastChild">
<mx:TileList dataProvider="{service.lastResult.rsp.photos.photo}" itemRenderer="Thumbnail" left="10" top="65" right="10" bottom="10"></mx:TileList>
</mx:AddChild>
<mx:SetProperty target="{input}" name="width" value="162"/>
</mx:State>
</mx:states>
<mx:Panel width="400" height="100" layout="absolute" title="Photos" id="panel1" resizeEffect="Resize">
<mx:Label x="23" y="22" text="Tags"/>
<mx:TextInput x="63" y="20" id="input" text="pink"/>
<mx:Button x="241" y="20" label="Find" click="currentState='results'; service.send();"/>
</mx:Panel>
</mx:Application>
Thumnbail component source code updated too
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="300" height="150" horizontalScrollPolicy="off" verticalScrollPolicy="off" borderStyle="none">
<mx:Fade id="fade" target="{this}" />
<mx:Image id="img" source="http://static.flickr.com/{data.server}/{data.id}_{data.secret}.jpg" completeEffect="fade.playEffect()" />
</mx:VBox>
Flash-Ripper.com 12:52, 12 May 2006 (PDT)
