Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6761807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:14:08+00:00 2026-05-26T14:14:08+00:00

I recently learned how to work with API’s in Flash Builder. So I made

  • 0

I recently learned how to work with API’s in Flash Builder. So I made this (note: it has no errors and it works in a normal Flex application:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               width="957" minWidth="800" minHeight="600"
               creationComplete="initApp(event)">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
        <s:HTTPService id="myRequest"
                       resultFormat="e4x"
                       url="{api_request}"
                       result="getMyPhotos(event)">

        </s:HTTPService>
    </fx:Declarations>

    <fx:Script>
        <![CDATA[
            import mx.collections.XMLListCollection;
            import mx.events.FlexEvent;
            import mx.rpc.events.ResultEvent;

            [Bindable]
            public var api_request:String;

            protected function initApp(event:FlexEvent):void
            {
                btnClear.addEventListener(MouseEvent.CLICK, leegAlleVelden);
                btnSearch.addEventListener(MouseEvent.CLICK, zoekOpFlickr);
                flickrFotoCollection.addEventListener(MouseEvent.CLICK, haalFoto);
            }

            protected function zoekOpFlickr(event:MouseEvent):void
            {
                var api_URL:String = 'http://api.flickr.com/services/rest/';
                var api_method:String = 'flickr.photos.search';
                var api_key:String = '290845e3c32e4e10a9e4b09fd993ddb9';
                var api_tags:String = txtSearchString.text;
                api_request = api_URL + '?method=' + api_method +
                    '&api_key=' + api_key + '&tags=' + api_tags;
                myRequest.send(); // hier maak je connectie met flickr
            }

            //http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=290845e3c32e4e10a9e4b09fd993ddb9&tags=cat&format=rest&api_sig=93e43cc21b7209d2e59af67736d27eb3

            protected function leegAlleVelden(event:MouseEvent):void
            {
                txtSearchString.text="";

            }

            protected function getMyPhotos(event:ResultEvent):void
            {
                //photos allemaal ingelezen
                flickrFotoCollection.dataProvider = new XMLListCollection(myRequest.lastResult.photos.photo);
            }

            public function haalFoto(selectedFoto:Object):String {
                // http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}_[mstb].jpg
                var farm_id:String = selectedFoto.@farm;
                var server_id:String = selectedFoto.@server;
                var id:String = selectedFoto.@id;
                var secret:String = selectedFoto.@secret;
                var size:String = 't';
                var api_selectedPhotoURL:String = "http://farm"+farm_id+".static.flickr.com/"+server_id+
                    "/"+id+"_"+secret+"_"+size+".jpg";
                return api_selectedPhotoURL;
            }

            public function toonFoto(event:MouseEvent):void
            {

            }

        ]]>
    </fx:Script>

    <s:BorderContainer x="0" y="21" width="800" height="100%" backgroundColor="#000000">
        <s:HGroup x="30" y="14">
            <s:TextInput x="0" y="23" width="267" id="txtSearchString"/>
            <s:Button x="289" y="24" label="Search" id="btnSearch" click="zoekOpFlickr(event);"/>
            <s:Button x="394" y="24" label="Clear" id="btnClear" click="leegAlleVelden(event);"/>
        </s:HGroup>

        <s:HGroup x="30" y="54" width="742" height="500">
            <mx:Tile width="399" height="500">
                <mx:Repeater id="flickrFotoCollection" dataProvider="{myRequest.lastResult.photos.photo}">
                    <s:Image id="fotoKlein"
                             source="{haalFoto(flickrFotoCollection.currentItem)}"
                             click="toonFoto(event);"
                             width="80" height="80"
                             scaleMode="stretch"/>
                </mx:Repeater>
            </mx:Tile>
            <s:Image id="fotoGroot" width="336" height="500"/>
        </s:HGroup>

    </s:BorderContainer>
</s:Application>

Next, I wanted to see if I could get it to work in a 4.5.1 mobile application. I didn’t get any errors except for a “could not resolve <mx:Repeater>…” At line 87. So for some reason it doesn’t recognize the <mx:Repeater> tag?

I tried to find the cause of this problem, but didn’t find it.

Is there a reason why it works in a normal application, but not in a mobile application?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:14:09+00:00Added an answer on May 26, 2026 at 2:14 pm

    The MX Components are not supported in a Mobile Project. For that code to compile in a Flash Builder mobile project you will have to manually add the SWC with MX components to the library path. Be prepared for poor performance, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I recently learned of the new JavaCompiler API available in JDK 1.6. This
I recently asked about functional programs having no side effects, and learned what this
I recently learned about the right way to work with reverse iterators in C++
The project I work on has recently been switched from a horribly antiquated revision
I'm still a C++ newbie who has only recently learned some file manipulation. I
I recently learned about strides in the answer to this post , and was
I recently learned I could run a server with this command: sudo python -m
UPDATE: I recently learned from this question that in the entire discussion below, I
I recently learned that I could do this: height()+100); So I when I tried
I recently learned about the basic structure of the .docx file (it's a specially

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.