Android development in Flash CS5, help needed.

Hi,
so I'm relatively knew to developing Flash applications that run on Android and have a lot of unanswered questions (Google has been searched!). Basically I'm building an MP3 player for my dissertation that will run on Android 2.2 using the extension for Flash.
The main question is, is it possible to load a song from the SD card into a flash application using a button in the flash document? if so,
is there anyone that can point me in the right direction as how to do this? any help would be greatly appreciated, Thanks
-Henry

Hi,
Use the below code to load and play an audio:
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.media.Sound;
import flash.net.URLRequest;
var s:Sound = new Sound();
s.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
s.addEventListener(Event.COMPLETE, onLoadComplete);
s.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
/* testAudio.mp3 is located at the same path where the .swf file is placed */
var req:URLRequest = new URLRequest("testAudio.mp3");
s.load(req);
function onLoadProgress(event:ProgressEvent):void {
    var loadedPct:uint =  Math.round(100 * (event.bytesLoaded / event.bytesTotal));
    trace("The sound is " + loadedPct + "% loaded.");
function onLoadComplete(event:Event):void {
    var localSound:Sound = event.target as Sound;
     /* Play the audio */
    localSound.play();
function onIOError(event:IOErrorEvent) {
    trace("The sound could not be loaded: " + event.text);
For better understanding of Sound Class refer the link :
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html
For how to load a file from SD in AIR 2.5 for Android :
import flash.filesystem.File;
var file:File = File.documentsDirectory.resolvePath("music/testAudio.mp3");
if (file.exists) {
     trace(file.url);
     s.load(new URLRequest(file.url));
Hope it helps.

Similar Messages

  • Adobe Flash CS5 - help needed animating a sentence so each word fades in seperately

    I am attempting to make a simple music video.
    My aim is to have lyrics to the piece of audio appear in synchronisation.
    There does not seem to be a simple way to fade in (and out) each word singularly allowing the alignment and sentence position to remain constant.
    Please help.

    Put the words on the stage as you want them to show when completed. Set that layer in the timeline as a masked layer. Add a new layer on top of that layer, set it to be a mask layer. In this new layer draw a rectangle that covers just the first word of your text. Move down a few frames and add a new keyframe to the mask layer. At this keyframe make the rectangle larger, to cover two words. Repeat as needed until all of the words are covered.
    Here is a link to a video that shows something similar: Flash Masking Tutorial - YouTube

  • Voice recognition support in mobile air application developed using Flash CS5.5

    I want to develop an android application via Flash CS5.5 which takes the command based on voice or convert voice in to text. Voice recognition support is available in android SDK but it is not available in latest Air SDK.
    I tried on Google to find out how to develop Voice recognition mobile application in Flash CS5.5 but did not find anything. There is some example/video which shows hack around native android code but this is for Flex not for the Flash.
    Waiting response?
    Thanks
    RTY

    Hi Rty,
    I think you should use  a native extension.
    Have a look at this link:
    http://extensionsforair.com/extensions/speech-recognition/

  • Flash CS5 Newbie - Need help adding URL link to animated banner

    I apologize if this is a very basic question, but I am a newbie at designing in Flash. I have created a basic animation in Flash CS5 and I need to add a clickable URL link to it. I've tried a few tutorials that looked promising, but none of them solved my problem. I've tried a number of things including converting parts or all of the images to simple buttons or movies and linking them that way as well as typing in code for ActionScript 2 and 3, none of which were successful. The animation plays correctly when viewed in my browser, but when I click on it, the link does not work. I would prefer that the entire banner be clickable to take viewers to the linked website rather than using hyperlinked text. Also, when I open the Code Snippets window, it is empty, no matter what image or frame I've selected. Do I need to import code snippets from somewhere or am I simply going about things the wrong way? Any help is greatly appreciated!

    It all depends whether you're decisively using AS2.0 or AS3.0 .
    In the latter, you would need to use a URLRequest() method in conjunction with a navigateToUrl() call (not sure the exact syntax for navigate to Url, it might be a capitalized "URL" in the method but the request takes a String argument such as http://www.adobe.com)

  • Packaging adobe air with android app in flash cs5

    Hi,
    I have developed a very simple app in flash cs5 and am ready to upload it to android market. However, users need adobe air to run it. Does anyone know if there is some way to package the app with air? I want to make it as easy as possible for people to run the app. Users will be prompted to download air and I can put this information on the apps page on android market but if there is some way to iclude this in the apk I'd love to know. Can't seem to find information on it on the web.
    Thanks

    Hum, thought so. Usually if there seems to be no answer to something on the web it's not possible!! Thanks.

  • Edit website flash template - help needed

    Hi! I am about to buy a website flash template. Before I buy the template I want to make sure, that I am good enough to edit to my needs.
    I downloaded a free flash template and I tried to edit it in my Flash CS5.
    I have had a lot of trouble editing it and I can't even figure out how I change the pictures or the text.
    Can anyone help me and maybe give me a little tutorial on how to change the template.
    Link to the template: http://www.flashmo.com/preview/flashmo_247_3d_touch_ring
    Thank you!

    The photos are taken from a XML file. Open the XML file flashmo_247_photo_list' in dreamweaver and look at the code it'll be easy to fiqure out if you have ever done any sort of HTML coding.
    Just incase you have'nt look for Example below taken from the xml file which was provided with the .fla file
    "<photo>
      <thumbnail>s_photo_003.jpg</thumbnail> Change the image name for a thumbnail here  i.e. directoryname/imagename.png etc
    <filename>photo_003.jpg</filename> Change the image name for a the large image here  i.e. directoryname/imagename.png etc
      <tooltip>Photo Title 03</tooltip>  
    <description><![CDATA[<p class="subtitle">Photo Title 03 goes here</p><p>In velit urna, <u>convallis id</u>, pharetra in, iaculis sit amet, mi. Praesent consectetur imperdiet mauris. Suspendisse at pede vel lorem pulvinar laoreet. Etiam et neque. Donec dapibus viverra est.</p><p><span class="note">This text is dynamically loaded from the external XML file. This textfield supports HTML and CSS.</span></p>]]></description> Here you have the option to have a discription about the image i usually just have the name of the image.
    </photo>"

  • Flash CS5 Help runs Lotus Notes???

    Hi, I just got Flash CS5 installed on my desktop and when I click Help on the menubar it kicks off my default mail program, Lotus Notes! I don't see anything in preferences to control this. Do I need a reinstall?
    Thanks!

    There are numerous getting started tutorials online (if you need them), but you could also check out this animation learning guide that will help you when it comes to the tweens (rotating, moving): http://www.adobe.com/devnet/flash/learning_guide/animation.html
    You might also want to look into using IK: http://www.adobe.com/devnet/flash/articles/spring_tool.html has a lot of good examples.

  • Android app in Flash CS5 getting menu to pop up using actionscript

    Hi,
    anyone out there know how to get a menu to pop up in Flash CS5 when coding for an android app.
    Basically I have a nice, simple app that when you press the menu  button  on your phone I want a movie clip to pop up at the bottom of the  screen  that then acts as a menu for the app. When you press the menu  button  again the movie clip disappears. There is some code in the  sample files  in flash cs5 but it won't seem to work for me.
    Has anyone gotten this to work successfully for them.
    This is the code that is in the sample file with flash
    options_mc.visible = false;
    function fl_ExitApplication(event:MouseEvent):void
        NativeApplication.nativeApplication.exit(0);
    stage.addEventListener(KeyboardEvent.KEY_UP, fl_OptionsMenuHandler);
    function fl_OptionsMenuHandler(event:KeyboardEvent):void
        if((event.keyCode == 95) || (event.keyCode == Keyboard.MENU))
            if(options_mc.visible == false){
                options_mc.visible = true;
                options_mc.addEventListener(MouseEvent.CLICK, fl_ExitApplication);
            } else if(options_mc.visible == true){
                options_mc.visible = false;
                options_mc.removeEventListener(MouseEvent.CLICK, fl_ExitApplication);
    This code is supposed to make the menu popup and when clicked you exit the app.
    I want someting similar to hppen without the movie clip making the app exit. My movie clip has other little buttons that make different information appear as you click on each one.
    Any advice is much appreciated. have app ready to go apart from this one little error.
    Thanks

    Ok this problem gets even weirder!! The code above kind of works. What I mean by that is in the exact same app the menu might pop up once every so often. Seriously, some times it works after I run the app for about 30 seconds and some times it doesn't work at all.
    Has anyone heard of this before? It's getting very frustrating.
    Thanks

  • New to Flash CS5. Need some assistance.

    Hey,
    I want to learn flash cs5 and before that I had some queries:
    Some of my friends who are java programmers told me I need to know programming in order to learn flash. (Action scripting) I honestly don`t know any programming, so is it possible for me to learn flash? I will be using flash to make simple animation, like moving a car, smoke, clouds etc.
    So I am good with photoshop/after effects and have a good design skills.
    Any assistance would be appreciated.

    Thanks for the reply.
    So as I told I have zero knowledge of programming, still I will be able to do animations in flash? Also as I told I am good with maya/photoshop/after effects.
    So if programming is not needed to learn flash, what are the advantages of using flash if we already know actionscript?

  • IPad Development Question - Flash CS5

    My friends and I were thinking about creating a few games for the iPad. With Flash CS5, there is an option to publish to iOS. With the conflict between Apple and Adobe... If we create a game in Flash and publish it to iOS, would Apple allow it in their App Store?

    http://labs.adobe.com/technologies/wallaby/
    http://labs.adobe.com/technologies/edge/
    Regards.

  • Adobe Flash CS5 Help!

    Hi. I am new here. I was wondering if someone could please help. I have tried look for tutorials but just couldn't find one that could help me do want to do in Flash. I am trying to make an animiation. I have a background with some text on it. The text says Happy Birthday and below it says Start. I added a motion preset to Happy Birthday. I made an invisible button and added that to Start since I want the animation to start when you click on start. I added the acton GoToandStop on Press and Release to go to the frame where there is an image of the presents. The action works and when you click on Start it goes over to that frame where the image of the presents are and stops. However, even when I don't click on Start it still goes on over to the frame where the present images are - I don't want it to do that. What should I do so that it doesn't do that? What I am doing wrong? Any help would be appreciated. Thank you so much.

    Miguel,
    Here is a link to a zip file with an FLA built what I imagine you are trying to accomplish, kind of:
    http://swfhead.com/files/FlashBasics.zip
    This is the very basics of using Flash with a little bit of ActionScript3.
    You'll notice on the timeline I have 5 layers.
         1. labels - this is where you will put frame label names.
         2. as - this is the layer where you will add any and all code
         3. txt_happyBirthday - on this layer is an animated text field (wrapped in a movieClip)
         4. btn - there is an invisible "_square" movieClip on stage with an instance name of "btn"
         5. Start - this is simply static text.
    Open up the Actions Panel on frame 1 of layer "as" and there is a small amount of code to control the movie. There is a deal of comments to assist you.
    Here is what is on that frame (it is easier to read in the file):
    // The code for any mouse events needs to be imported
    import flash.events.MouseEvent;
    // stops the playhead at the current frame
    // so it does not continue.
    // This takes no "parameters" as stop doesn't
    // need any to do what it needs to do.
    stop();
    // Button Code
    // We want to have our "button" tell Flash to do something
    // when it is clicked.
    // This is a little more complex in ActionScript3 vs AS2, but the
    // following code is the most basic of all AS3.
    // First we have an "event listener" for the button.
    // This is so we can wait for something to happen to it
    // before responding. The function at the end is what happens
    // when btn hears the CLICK mouse event.
    btn.addEventListener(MouseEvent.CLICK, btnMouseClickHandler);
    // Now we want to respond to the CLICK event
    // In this first line we open the function.
    // It has an event type of MouseEvent, meaning that that is
    // what kind of event we are responding to.
    function btnMouseClickHandler(event:MouseEvent):void
              // This line tells our playhead to go to and play at a
              // defined frame. In this case, we have a frame label of "motion"
              // on frame two. But you can also use a frame number but not have it in quotes.
              gotoAndPlay("motion");
              // You can add a frame label on a frame by creating a new keyframe
              // (notice how I have a layer called "labels"), selecting it, and
              // adding a label in the Properties Panel.
              // You can also use gotoAndStop() to stop on a frame.
    I suggest starting by watching the videos on AdobeTV:
    http://tv.adobe.com/show/learn-flash-professional-cs5
    Also, You can learn the fundamentals of Actionscript 3 here:
    http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-8000.html
    It is a little bit daughnting but there is a lot of good info there.
    This can all be a little bit frustrating at first, but don't let that stop you. Flash really does get fun from here.
    Happy Flashing!

  • How can I publish a tablet size only app to the android market using Flash CS5.5?

    I've developed an app to run on a tablet and would like to sell it in Googles Android Maket.    I uploaded the .apk file to the android market however, the settings indicate that the app will work on small to large screen sizes.
    Is there anyway I can specify that the app is only suitable for large (tablet) size devices?  I believe there are some tags in the <manifest> section, which I think must be part of the .apk package Flash creates.
    <supports-screens
    android:smallScreens="true"
    android:normalScreens= "true"
    android:largeScreens="true"
    android:xlargeScreens="true"
    android:anyDensity="true" />
    Can I alter these tags manually somewhere or is there some other way to specify the device size?

    If you publish folio as Public/free then it will appear in app library and users can download folio and read folio content. You can test folio in ACV.
    If you publish folio as Public/retail then it will only appear in library once associated in-apppurchase is approved by Apple. You can test folio in developer.ipa.
    Woraround: You can create test app and keep title id as your application account in whch you published your folio and test developer.ipa. If folio is working fine in test app then publish it in LIve app.

  • Embedding Flash Video - Help needed!

    I'm fairly new to Flash and trying to embed a video to my
    website. When I import my video and test the movie, it works
    perfectly, showing the controls at the bottom and everything. When
    I add it to Dreamweaver and test the page, it only shows the video
    (sans media controls) and automatically plays when the page is
    loaded. What am I doing wrong??
    I'd like to upload the flash video w/media controls beneath
    it, to dreamweaver and it remain paused until the viewer hits the
    play button.
    Can anyone help?

    kyconjim wrote:
    > I'm fairly new to Flash and trying to embed a video to
    my website. When I
    > import my video and test the movie, it works perfectly,
    showing the controls at
    > the bottom and everything. When I add it to Dreamweaver
    and test the page, it
    > only shows the video (sans media controls) and
    automatically plays when the
    > page is loaded. What am I doing wrong??
    >
    > I'd like to upload the flash video w/media controls
    beneath it, to dreamweaver
    > and it remain paused until the viewer hits the play
    button.
    >
    > Can anyone help?
    Dreamweaver does not reflect full functionality, you need to
    upload your stuff to
    server or test in browser. Best way to make sure things
    works.
    If your HTML refer to the SWF in some directory, make sure
    you have correct paths
    to the player skin (the video controls).
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Newbie flash site help needed

    I am building my first website (for photography) and I am
    trying to learn as much as possible to do it right. I bought a
    flash template from Tempate Monster.com (#11226) and I have
    modified as needed, to include my name, and my photos. Can I upload
    this site as a whole onto the net? or do I need to input that into
    Dreamweaver or similair? Next question, is as the pages are all
    movies essentially, can I add more pages? And lastly, can I
    reference a 2nd flash template from the first, as I want to buy
    another template, which is more geared towards a photogallery,
    rather than an information database.
    Thanks for your time, I feel I am right there....but then
    again, so far away!!!

    Hi there, looks like you posted this one a couple days ago
    but incase you come back to check I think I can help.
    Well, if you're using a template within flash you can simply
    use shift+F12 to publish the site. It will create a .html, and .swf
    file in the same directory you have the .fla flash file stored. To
    publish to the web, upload the .html and .swf file to your public
    web directory. Simple as that.
    no problem linking pages etc. Just create a button and link
    use getURL(website,"_self") in your onRelease event handler. Happy
    to give more detail if you like.
    Cheers,
    Tom

  • 9i Developer suite login problem. help needed ASAP

    i installed oracle 9i developer suite, my problem is i can't login. this is the error ora12560: TNS: oracle adapter error.
    or
    if i put the hostname it displays a no listener error and closes. i tried to create a listener in net configuration assistant, but i can't see it in services.
    i'm using windows XP. and not conneted to any machine.
    do i need any changes on my window settings?
    please help...
    thanks
    here is my listener.ora
    ABC =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = abc)(PORT = 1521))
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = abc)(PORT = 1521))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\OraHome)
    (PROGRAM = extproc)
    tnsnames.ora
    TEST.ABC =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ABC)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = test.ABC)
    ORACLE =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = abc)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = oracle)

    check your operating system network protocole is TCP/IP is installed if so check is there any problem with these protocoles. this error is encounter generally due operating system network protocoles it is not an oracle error. here is discription.
    TNS-12560 TNS:protocol adapter error
    Cause: A generic protocol adapter error occurred.
    Action: Check addresses used for proper protocol specification. Before reporting this error, look at the error stack and check for lower level transport errors.For further details, turn on tracing and re-execute the operation. Turn off tracing when the operation is complete.

Maybe you are looking for

  • Limitation on mails in Iphone 5 with IOS7

    Hi, Is there any way where i can limit the mails on my Iphone 5 updated to ios 7.0.3. The earlier ios 6 had an option to limit it but i am unable to find the option for ios 7. I have 7 mail ids and and it is consuming more space on my device. If i ca

  • Does my extended warranty cover the casing?

    Some time ago, I bought a lock for my MacBook Pro. It seemed kind of flaky, but I think it's pretty much the standard lock. You simply inserted one end of the lock into a tiny hole on the right side of the computer's exterior (I don't know if "casing

  • What is the best way to partitioning Macbook Air 13" 2012 solid state drive

    What is the best way to partitioning Macbook Air 13" 2012 solid state drive.

  • Error in Claims Approval Process

    Hi, I Configured ESS.I applied LTA Claim through portal.It went fot the approval to the approver.It is there in Universal Worklist of Approver but when he clicks on it to approve instead of opening WebDynpro iView it is giving an error that "Portal R

  • Variable with offset error

    Dear gurus, On my query i have a variable V1 ( user input ) for the period char ( 0fiscper3 ). I need to have a column with values from period imputed on V1 + 1 until period 13, but when user inputs on V1 value 12 ( 12 + 1 = 13 ), values for period 1