talkxe

riaxe snippets

Follow me on TwitterRSS Feeds

  • Home
  • About Us

Publish into facebook wall from flex

Apr 21st

Posted by Brajendra in actionscript

13 comments

Recently, was working on a facebook application using flex and when i had to post/share a video to the facebook wall. I was using the conventional share method, had to navigate to another url and then share. Found an alternative way and better approach to post it directly from flex to anyone’s wall. We can do that by using the PublishPost method of the facebook actionscript api. But to do so the user must grant the permission to publish that into his wall. Now, in order to grant the permission there is grantExtendedPermission(S) in the facebook class.

Below is the complete code which posts a flash movie into the facebook wall from the flex application.

Step 1
First check whether the user has permission to post the movie into the wall. If permission is already granted then post directly to the wall else go for the permission post.

var call:HasAppPermission = new HasAppPermission(ExtendedPermissionValues.PUBLISH_STREAM, uid)
call.addEventListener(FacebookEvent.COMPLETE, onPermissionCheckComplete);
facebook.post(call);

Step 2

private function onPermissionCheckComplete(vEvent:FacebookEvent):void
{
if(vEvent.success && (vEvent.data as BooleanResultData).value)
{
publishOnWall();
}
else
{
facebook.grantExtendedPermission(ExtendedPermissionValues.PUBLISH_STREAM);
}
}

Step 3
Publish a flash movie into the wall

private function publishOnWall():void
{
var message:String = "publish a flash into the wall";
var attachment:Object= {media: [{
type: "flash",
imgsrc: "image url",
swfsrc: "flash url",
width: '110', height: '110', expanded_width: '280', expanded_height: '280'
}]};
actionLinkData:ActionLinkData = new ActionLinkData();
actionLinkData.href = "action link url";
actionLinkData.text = "caption";

var post:PublishPost = new PublishPost(message, attachment, [actionLinkData],target_id, uid');
var call:FacebookCall = facebook.post(post);

A little tip for the Facebook application developers using Actionscript. Good luck :)

Share
actionscript, as3, facebook, flash, flex, grantExtendedPermission, publish, share, stream

Displaying MovieClip as icon in a TileList in Flash AS3.0

Mar 24th

Posted by Susrut Mishra in actionscript

No comments

I wasted a whole day finding how to display movieclip classes as icons in a Flash TileList component(AS3 version). I tried loading the data from an external XML file containing label and icon tags as dataprovider for the tilelist, it displayed the labels properly but had issues displaying the icons.

I used the iconField property for e.g tileList.iconField = “icon”;
That too didn’t work for me.
I changed the icon tags to source tag and removed the iconField property and guess what….it worked!!!

Herez the XML

<data>
<item>
<label>Flex</label>
<source>MC1</source>
</item>
<item>
<label>Flash</label>
<source>MC2</source>
</item>
<item>
<label>ColdFusion</label>
<source>MC3</source>
</item>
<item>
<label>PHP</label>
<source>MC4</source>
</item>
</data>

Hope this helps!!! :)

Share
as3, cs4, flash, icon, iconfield, tilelist

Highlight lines in a TextArea

Nov 8th

Posted by Susrut Mishra in actionscript

No comments

I just went through today in adobe forum and found an interesting topic. The exact forum url – http://forums.adobe.com/thread/518365?tstart=0 . I tried to find a solution and got it.

It is about highlighting a set of lines in a textarea. Its nothing a big deal, I just followed 2 steps

- one to calculate the number of lines and give an option of selecting/deselecting those lines.

- second set the selection when its option is selected.

I have put up a demo here . Have a look.

Direct link -

http://www.riaxe.com/blog/demo/textareahighlight/TextAreaHighlightLines.html

Share
actionscript, as3, flex, highlight, lines, textarea

Rotating text along a circular arc in as3

Jul 27th

Posted by Susrut Mishra in actionscript

7 comments

Googled around for a demo related to placing text over an arc in as3.0…found some solutions but were not satisfactory. So decided to create a simple demo of rotating text along a circular arc. The demo includes dynamic text entry, dynamic arc radius and text spacing.

You can find the demo here.

circletxt

Share
actionscript, arc, as3, circular, flex, rotate, text

Adding Singleclick, Doubleclick and Drag events all at a time in as3

Jul 10th

Posted by Susrut Mishra in actionscript

5 comments

Recently I had an issue with combining things like singleclick, doubleclick and drag on a single control.  I used a timer to solve the issue. I have called the startDrag method after starting the timer for the singleclick.

Prepared a demo for the above solution. One can find it here.

Hope its useful. Cheers :)

Share
actionscript, as3, doubleclick, drag, flex, singleclick
«12345»
    • Popular posts
    • Archives
    • Tags
    • Categories
    • .NET (1)
    • actionscript (20)
    • AIR (2)
    • as2 (2)
    • as3 (16)
    • facebook (1)
    • flash (12)
    • flex (17)
    • JAVA (1)
    • Javascript (2)
    • mobile (1)
    • s60 (1)
    • symbian (3)
    3d actionscript AIR alivepdf arc as2 as3 button circular components corner cs4 cube doubleclick drag dynamic externalinterface fabridge flash flash builder flex gradient highlight icon iconfield jar JAVA Javascript lines matrix merapi message mouse pdf player resize rotate scale singleclick text textarea textrange text scaling tilelist transform tool
    • January 2012 (2)
    • December 2011 (1)
    • October 2011 (1)
    • August 2010 (2)
    • July 2010 (1)
    • June 2010 (1)
    • May 2010 (2)
    • April 2010 (1)
    • March 2010 (1)
    • November 2009 (1)
    • July 2009 (2)
    • April 2009 (1)
    • March 2009 (3)
    • February 2009 (1)
    • January 2009 (3)
    • AS3 Transform Tool for scaling, rotating components containing text controls in Flex (30)
    • Flex Firefox Flash Debug Player Crash [Solved] (16)
    • Simple tutorial for creating an AIR application using Merapi Bridge (13)
    • Publish into facebook wall from flex (13)
    • Alive PDF from Flash Player 10 issue (7)
    • Rotating text along a circular arc in as3 (7)
    • Adding Singleclick, Doubleclick and Drag events all at a time in as3 (5)
    • Using mouse position from Javascript into Flex (3)
    • Dynamic TextArea control that resizes with the text content (2)
    • AS3 Transform tool [Flex 4 Support] with text scaling and dynamic menu (2)
  • Twitxe

    Loading tweets...
    Follow me on Twitter!
  • Resources

    • ByteArray.org
    • Flex Examples
    • InsideRIA
    • lab.polygonal.de
    • Reflektions.com
    • ScaleNine
    • Senocular
    • The Official Flex Team Blog
Copyright © 2009 ::RIAXE:: | The solving side