Posting from AS3 to Twitter
Hey all,
I've got a main menu and a game which loads as a separate swf from that menu. So far when the player enters their name at the start on the main menu I can get this name to post to Twitter. Also when the player completes the game I get post their time onto Twitter.
The problem is that I want to take the name posted from the main menu and dispatch it and only when the player completed the game post their time and name to Twitter.
Code in main menu to dispatch name:
[CODE]
var NameTextField:TextField = new TextField();
var MyFormat:TextFormat = new TextFormat();
addChild(NameTextField);
SubmitButton.addEventListener(MouseEvent.CLICK, SubmitClicked);
function SubmitClicked(e:MouseEvent)
dispatchEvent(new Event(NameTextField.text, true));
trace (NameTextField.text);
NameTextField.selectable = false;
[/CODE]
Code in game to receive name and post time to twitter.
[CODE]
navigateToURL(new URLRequest('http://twitter.com/home?status='+encodeURIComponent(+NameTextField.text+" completed Game"+' in a time of '+HourText.text+':'+MinuteText.text+':'+SecondText.text+'')),'_blank');
[/CODE]
Hi Ahmet
1. you could have simply used cost ele category 1 to post from Fi to COPA
2. 11 or 12 is needed only in case of postings from SD module
3. If you post 11 or 12 from FI w/o assigning a CO object, system issues an error msg.. you can convert it into warning
The cost ele categories and their +/- signs are as below
12: Credit in FI = Minus in COPA
Debit in FI = +ve in COPA
11: Credit in FI = +ve in COPA
Debit in FI = Minus in COPA
01: Credit in FI = Minus in COPA
Debit in FI = +ve in COPA
Regards
Ajay M
Similar Messages
-
Ok right now I am REALLY confused. About a week ago, I went to post something on twitter. Naturally, instead of having to go to twitter.com and signing in, I used the Notification center "Click to Tweet" button to make my post. It worked just as you would expect. The little screen popped up, I typed my post and tweeted it.
Just a few days ago, both the Tweet and Facebook Post buttons stopped working. I can click on them all I want, but the little index card-like screen never shows up. I don't know what the issue is, since I had both buttons working a few days ago. To try solving the issue I:
1. Went into the settings for notifications and "Hid" the buttons from Notification center (that didn't work)
2. Removed both my accounts from my laptop and re-added them (that didn't work)
3. Checked to see that the password was correctly typed in... it was (and that still didn't work)
The only thing I have left to do is try shutting down my laptop and restarting it. However I recently had some iPhoto software updates that required the laptop to be restarted. Even though this was after the problem started, it still didn't fix it.
One more thing to note is that in Safari where the "Share" button is... that still works fine. I shared a website I was on to Facebook and it posted successfully. The only problem is the functions in Notification Center.
If anybody has a solution to this issue where the Tweet and Facebook Post buttons stop functioning for Notification center, I would really appreciate it. Thanks
- Dan (ThunderBow98)
NOTE- One other thing. Notifications from Facebook and Twitter still work, however. For instance, I just got a friend request approved on Facebook and that appeared as it should with the little banner notification as well as it appearing in my list of notifications. Somebody re-tweated my tweet and that appeared there too. The only thing that isn't working is the posting features.
Message was edited by: ThunderBowSame thing with me but the Safari thing also doesn't work. I recently changed my twitter username so I thought that might be the problem, but no it isn't. Unfortunately, I can only complain with you, not help you, I apologize, Dan!
What computer+ Mac os are you using? I am MacBook Pro with 10.8.4?
-Anonymous Sir -
Passing variables from AS3 to PHP
Hi there
I am having some trouble in passing variables from AS3 to PHP. I am using flash and php both in the same file [try.php].
I've stuck with this for two days.. Here's what I have done. Please help!!!
header.fla [Actionscript in the timeline]
stop();
import flash.events.Event;
import flash.display.Sprite;
import flash.net.*;
var url:String = "http://localhost/0000/try.php";
var req:URLRequest = new URLRequest(url);
var loader:URLLoader = new URLLoader();
var variables:URLVariables = new URLVariables();
send_btn.addEventListener(MouseEvent.CLICK, sendForm);
function sendForm(evt:MouseEvent):void
// add the variables to our URLVariables
variables.asd = "value";
// send data via post
req.method = URLRequestMethod.POST;
req.data = variables;
loader.dataFormat = URLLoaderDataFormat.TEXT;
// add listener
loader.addEventListener(Event.COMPLETE, onLoaded);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
//send data
loader.load(req);
function onLoaded(evt:Event):void
var result_data:String = String(loader.data);
if (result_data)
trace(result_data);
else if (!result_data)
trace("error");
function ioErrorHandler(event:IOErrorEvent):void
trace("ioErrorHandler: " + event);
try.php
<body>
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="563" height="280">
<param name="movie" value="header.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall" value="../Scripts/expressInstall.swf" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="header.swf" width="563" height="280">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<param name="expressinstall" value="../Scripts/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
<?php
if($_POST['asd'])
echo "value of var1 is <b>".$_POST['asd']."</b>";
else
echo "bad luck";
?>
</body>
BIG THANKS!!the problem is nothing your showed. did you see a security warning that you ignored?
to test, if that's the problem go here and adjust your security settings: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.ht ml
if that fails, upload your files to a server and confirm everything works. then start working on your local configuration. -
Passing html from AS3 to Javascript
I am using WebStageView to pass html from AS3 to a Javascript function in a webpage.
I do this like:
var urltext:String = "javascript:setText('aaa','vvv')"
webView.loadURL(urltext);
This successfully calls a function in JS named setText which in turn sets the value of a div or whatever else I want to do.
Here is the problem:
If I want to pass:
var urltext:String = "javascript:setText('<p>aaa</p>','vvv')" the formatted text works fine and I get no errors however,
if I pass it like this:
var txt:String = '<p>aaa</p>';
var urltext:String = ""javascript:setText('+txt+','vvv')" then I get a parse error;
It traces out to look like this:
urltext: javascript:setText('<p>aaaaa</p>
','vvv')
Notice that there is a return after the </p> which is apparently causing the parse error.
I am loading text from a file and passing it via the above call to JS.
In short, is there a way to format the text so it doies not cause the parse error?
Or, is there a better way to pass html strings in a call to Javascript?
ExternalInterface does not seem to work anymore and I am avoiding WebStageViewBridge.Ain't that the way of it..
Came up with a solution Minutes after I posted this problem.
Here it is, just in case:
var urltext:String = "javascript:setText("+com.adobe.serialization.json.JSON.encode(fileText)+",'vvv')" -
Hi all,
I am using Mail as a client to my Gmail account.
I am registered with such account to receive notification about new posts from Apple Support Communities on which I took part.
However when I receive a new mail notifications, I get a huge list of post, it basically seems the whole conversation.
Even if the grouping done by Mail App shows 1 message only, I can see lot of posts attached to the mail.
Apparently by deleting the group or the very latest mail, it deletes the whole conversation, but everytime a new mail arrives, the conversation shows again.
By doing a search for sender and subject on notification arrival, only one mail shows from the results.
When deleting the mail, the whole conversation gone from Mail App, did the search again with same criteria, and got 0 result.
Why this behavior ? Am I missing something ?*I figured it out!*
Simple fix, here is what you do - open Mail v4.2 > Preferences
Select your Gmail account with this weird problem (I say select, cause in my situation I have multiple Gmail account setup but was having trouble with 1).
Then goto > Advanced tab
and then just type "/" (forward slash) - and then wait for a minute, it should fix it and allow to receive all the ghosts messages again - which apparently were visible under my online (web based) gmail.com's account also on my iPhone. You might see double messages, don't freak out like I did - Quit Mail v4.2 and restart that should go away as well, like in my case. Strange? Definitely
Anyways, hope this helps! -
Is it possible to do manaul posting from FI if the customer blocked
Dear All,
If the customer blocked in all the sales areas, is it possible to do manual posting from FI.
Kindly clarify.
Regards,
Mullairajahi raja,
yes, you are right because even sales area is blocked also you can post in FI
if it is blocked with COMPANY CODE LEVEL, then its a problem
hope this clears your issue
balajia -
Derivation Of partner profit center in COPA (Direct Posting from FI)
When posting from SD partner profit center is derived and transfered to COPA, so eliminations can take place.
When ever we made posting from SD, Partner profit center is coming from derivation rule which is exclusively for sales and maintained in transaction code 8KER.But whenever we made direct posting in FI, Data is transferred to COPA before profit center is derived as system does not find any data from COPA or in other words there is no any Derivation rule or table lookup or user exists in COPA from where we can derive the Partner profit center.
For testing purpose I made a derivation rule in COPA in KEDR with the same logic used in 8KER, Partner profit center is coming in COPA from this derivation rule. Derivation logic used in 8KER is very simple : source filed is KUNNR from table KNA1 and target Field is Partner Profit Center : PPRCTR from table CEPC.
I mean that i derive the partner profit center from customer number in 8KER transaction which is only for SALES and in EC-PCA only.
Now whenever I do a direct posting from FI, suppose using transaction code F-02
but partner profit center is not coming. I made a another derivation rule in KEDR in COPA and maintained the rule values there and I got the success for deriving the partner profit center.
But my query is that If I am maintaing rule values in 8KER then why I maintain the same duplicate data in KEDR.Can we use the same rule values from 8KER for direct posting of FI.
I have tried with Table lookup, derivation rule in KEDR but not getting any success.
Please tell me that without maintaing rule values in KEDR (as these are already maintain in 8KER)how I can derive the partner profit center from FI posting.Or in other words i can say that how we can get both PCA as well as COPA document with partner profit center in case of FI direct posting.
Thanks in advance.
With best Regards
Sandeep Seth
[email protected]
Thanks in advanceDear Paolo
we have live system, we also have cost center accounting active.
do u know how to active automatic posting in Profit segment through cost center.
For Example, i post document in FB60, i assign cost center against GL expense account, if i assign profit segment the amount reflects in COPA, but i want when i assign required cost center it automatically active the profit segment ?
hope you under stand my query!!!
Regards
MuR!!!! -
Problem in BAPI for stock posting from quality inspection to unrestricted usage
Hi all,
I am using BAPI_GOODSMVT_CREATE for stock posting from quality inspection to unrestricted usage Stock against quality inspection lot(not by MB1B) using mvt type 321.The material doc gets created by the BAPI,but actual stock posting is not taking place ie.the stock doesn’t get reflected in QA33/32 and QA11 also .Can any one suggest what must be wrong?The inputs given are as follows:
GOODSMVT_HEADER:
PSTNG_DATE =30/07/2014, DOC_DATE = 30/07/2014, REF_DOC_NO = INSP LOT NO.
GOODSMVT_CODE:
GM_CODE: ‘04’ .
GOODSMVT_ITEM:
MATERIAL = MATERIAL NO
PLANT = PLANTCODE
STGE_LOC = ‘WIP’
BATCH = BATCHNO
MOVE_TYPE = ‘321’
ENTRY_QNT = 100
ENTRY_UOM = ‘EA’
ORDERID = Prd ord no.
After executing this I used BAPI_TRANSACTION_COMMIT also. I am able to see the posted qty in MMBE,but it is not reflecting in QA11/33/32.
Kindly help me.Hi Naveen,
Thanks for the reply. Even after using FM QAVE_PROCESS_AUTO_UD,when i execute
BAPI_GOODSMVT_CREATE, the same thing is happening.I am unable to see the stock deducted in QA33.
Is there any input in the goods mvt bapi where we can provide inspection lot no since i believe that the goods mvt has to get connected with the inspection lot. -
Accounting document not posted from billing document SD module
Dear Sir,
I am encounting a weird issue in SD module, that is when I am saving the billing document the system will generate accounting document automatically from my ID but when the same process will perform from the other ID having same rights and previligies then system prompt the folllowing message .
"Tax code C1 does not appear in any G/L account item"
It means the system allow a specific user to post accounting document with reference to billing document but not allowing to post from any other ID.
Apparently this issue related to basis module. we have checked in the basis area as well . still unable to get ane resolution for this issue.
Best Regards,
HASEEB KHAN
MM,PP,SD CONSULTANTHello Haseeb,
In that case, I would suggest you check Change Message Control for Taxes follow following path in SPRO:
IMG - Financial Accounting (New) - Tax on sales/purchases - Basic setting - Change Message Control for Taxes
Check corresponding doc to it and go through different Application Area, particularly, FF
Also refer SAP Note 495737 - Customizable messages in FI_TAX_SV_BSEG_BSET_GROSS
Hope this can assist you in understanding
Thanks & Regards
JP -
Change Moving Average Price when Post Goods issue posted from VL02N
Hi all,
Please help me to find USER EXIT / BADI or Enhancement to change Price - MSEG-DMBTR
when Post Goods Issue posted from transaction VL02N.
Thanks in advance,
Mila.Hi,
Check these Enhancemnts...
Exit Name Description
V02V0001 Sales area determination for stock transport order
V02V0002 User exit for storage location determination
V02V0003 User exit for gate + matl staging area determination (headr)
V02V0004 User Exit for Staging Area Determination (Item)
V50PSTAT Delivery: Item Status Calculation
V50Q0001 Delivery Monitor: User Exits for Filling Display Fields
V50R0001 Collective processing for delivery creation
V50R0002 Collective processing for delivery creation
V50R0004 Calculation of Stock for POs for Shipping Due Date List
V50S0001 User Exits for Delivery Processing
V53C0001 Rough workload calculation in time per item
V53C0002 W&S: RWE enhancement - shipping material type/time slot
V53W0001 User exits for creating picking waves
VMDE0001 Shipping Interface: Error Handling - Inbound IDoc
VMDE0002 Shipping Interface: Message PICKSD (Picking, Outbound)
VMDE0003 Shipping Interface: Message SDPICK (Picking, Inbound)
VMDE0004 Shipping Interface: Message SDPACK (Packing, Inbound)
Badi Name Description
DELIVERY_ADDR_SAP Determine Time-Dependent Delivery Address in Delivery
DELIVERY_PUBLISH Returns BAdI Implementation: Automatic GR Posting T 2
DELIVERY_PUBLISH Updating of Delivery in Purchase Order
DELIVERY_PUBLISH AIP: Delivery Confirmation for Sales Order
Regards
Raghu -
How do i upload a photo from iPhoto to twitter?
hi peeps,
wonder if anyone can help...i have been trying to upload a pic from iphoto to twitter and it wont let me, the twitter icon is not able to be selected.
I have tried deleting my twitter info from preferences and re inputting it but that didnt work. the onlu option that is allowed currently is mail.
I was able to upload the pics to facebook last night but now the facebook button is not able to be selected too.
please help
many thanks
ianHave you tried to do it like this?
iPhoto '11: Share your photos on Twitter - Support - Apple
I have tried deleting my twitter info from preferences and re inputting it but that didnt work. the only option that is allowed currently is mail.
Are you saying, it is impossible to edit the accounts preferences at all? What happens, when you try? -
How do you convert this code from AS3 to AS2?
Hi,
I created some AS3 code that is working perfectly for us.
However now we need to convert it to AS2 so that it can be Flash
Player 8 compatible. If it could also be compatible for Flash
Player 7 that would be ideal but not a requirement.
Thanks in advance.Are you wanting someone to do the conversion for you, or are
you asking for general tips for doing the conversion yourself?
i can give you tips:
have a look at the
ActionScript
2.0 Migration page.
In this you'll find the property conversions eg(going from
AS3 to AS2). y becomes _y, height becomes _height, scaleX becomes
_xscale, void becomes Void etc.
you'll find that events need to be converted, eg.
particle.addEventListener(Event.ENTER_FRAME,
animateParticle);
becomes:
particle.onEnterFrame=animateParticle;
the onEnterFrame class doesn't pass an Event parameter to the
event listener. Instead, the event listener is automatically in the
scope of the event dispatcher, so instead of 'event.target' you
will be able to just target 'this'.
You'll need to use setInterval() instead of the Timer class.
You'll need to use attachMovie() instead of
addChild(). -
Change some code from as3 to as2
Hi, I want to use as2 because it compatible with my website.
I want to change some code from as3 to as2
/////////////////////////////image1//////////////////////////////// if(MovieClip(this.parent).imagetxt.text == "a") { var imgurl:String = "C:/Users/Thái/Desktop/ls/cotton-1.jpg"; var myrequest:URL = new URL(imgurl); myloader.scaleContent = true; myloader.load(myrequest); } /////////////////////////////image2//////////////////////////////// else if(MovieClip(this.parent).imagetxt.text == "b") { var imgurl2:String = "http://aloflash.com/images/upload/3.jpg"; var myrequest2:URLRequest = new URLRequest(imgurl2); myloader.scaleContent = true; myloader.load(myrequest2); }thank you for your support.use:
var myloader:MovieClip=this.createEmptyMovieClip("loader_mc",this.getNextHighestDepth());
if (MovieClip(this._parent).imagetxt.text == "a") {
var imgurl:String = "C:/Users/Thái/Desktop/ls/cotton-1.jpg";
myloader.load(imgurl);
} else if (MovieClip(this._parent).imagetxt.text == "b") {
var imgurl2:String = "http://aloflash.com/images/upload/3.jpg
myloader.load(imgurl2); -
Http post from an application with file attachment
Hi ! I didn't know where else to post this message...
I'm trying to make a HTTP POST from an application and upload a file with it. I have no problems with the posting, just that I haven't got any ideas how to get the file uploaded as well. I've been reading loads of examples regarding the topic, and searching older posts the forum here, without any help.
Here's the method i'm using:
// open connections
URL url = new URL ("TheURL");
URLConnection urlConn = url.openConnection();
// We do input & output, without caching
urlConn.setDoInput (true);
urlConn.setDoOutput (true);
urlConn.setUseCaches (false);
// multipart/form-data because we want to upload a file
urlConn.setRequestProperty ("Content-Type", "multipart/form-data");
// Open output stream
DataOutputStream printout = new DataOutputStream (urlConn.getOutputStream ());
// Set the actual content
String content = "upfile=" + System.getProperty("user.dir") + "\\file.ext&";
content += "other_key-value_pairs";
// write the data to stream, and flush it.
printout.writeBytes (URLEncoder.encode(content));
printout.flush ();
printout.close ();
// Get the response.
DataInputStream input = new DataInputStream (urlConn.getInputStream());
FileOutputStream fos=new FileOutputStream("postto.txt");
String str;
BufferedReader bufr = new BufferedReader(new InputStreamReader(input));
// Write response to outputfile
while (null != ((str = bufr.readLine()))) {
if (str.length() >0) {
fos.write(str.getBytes());
fos.write(new String("\n").getBytes());
input.close ();Now, the response here I get from the url i'm posting to is "Failure, no data-file". I've tried many diff methods of writing the file to the stream, but always get the same result.
I need to file attached like it would be when using a HTML form's <input type="file">.
Please help ! This is getting really urgent !String content = "upfile=" + System.getProperty("user.dir") + "\\file.ext&";
content += "other_key-value_pairs";
printout.writeBytes (URLEncoder.encode(content));
printout.flush ();
printout.close ();Actually, what this does is create a request like:
GET /path/to/file/script.language?upfile=/home/user/file.ext&other=params HTTP/1.1
Content-Type: multipart/form-data
-- And other HTTP params --
The file is not actually appended to the request.
I really don't know how Java handles the file upload, but you could do it by hand, like so:
public static void doFileUpload(String url, String filename, Hashtable params) throws IOException {
// Construct the request
String boundary = "----------------------mUlTiPaRtBoUnDaRy";
String request_head = "POST " + url + " HTTP/1.0\r\n" +
"Content-type: multipart/form-data; boundary=" + boundary + "\r\n";
String request_body = boundary + "\r\n\r\nContent-disposition: form-data; name=\"upload\"" +
"\r\n\r\n";
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
int b = -1;
while((b = in.read()) != -1) {
request_body += (char)b;
in.close();
Enumeration keys = params.keys();
while(keys.hasMoreElements()) {
String key = keys.nextElement();
requst_body += "\r\n" + boundary + "\r\n\r\nContent-type: form-data; name=\"key\"\r\n" +
(String)params.get(key);
request_body += "\r\n" + boundary + "--\r\n";
int length = request_head.length() + request_body.length() + "Content-length: \r\n";
String req_length = "Content-length: " + (length + new String("" + length).length()) + "\r\n";
Socket socket = new Socket(url,80);
PrintStream stream = socket.getOutputStream();
stream.print(request_head + req_length + req_body);
// And now an option to read the response, I will omit that...
}Note: I have not tested this code, just wrote it up out of memory. If it does not work, it will propably need some small fixes.
Tuomas Rinta -
Problem while sending ByteArray from as3 client through netconnection call method to red5 server
Hi to all,
I'm trying to send from as3 client a ByteArray of more or less 3 MB using NetConnection's call method but I am unable to do it, cause I get a timeout on the server and the client get disconnected (I have also increased the timeout limit in red5.properties but nothing changed). If I try to send a smaller ByteArray I don't have problem, even if the trasfer is really slow.
Any solution?
thanksput it in code tags so it's readable
CLIENT
public void sendLoginData(String data)
int c=0;
byte loginData[]=new byte[data.length()];
loginData=data.getBytes();
try
out.write(loginData);
System.out.println(client.isClosed());
// here i want 2 receive the 1 byte data whch i hv sent frm server's RUN() method
//following code is not working :( it gets hanged
while((c=in.read())!=-1)
System.out.print(c);
System.out.print("hi");
catch(Exception e)
System.out.println("Caught:" + e);
finally
out.close();
}SERVER
public void run()
boolean flag;
try
flag=verifyLoginData(ID); //this function verifies the login data by connecting to DB
System.out.println(flag);
if(flag==true)
//send login valid
bos.write(1);
bos.close();
else
//send login invalid
bos.write(0);
bos.close();
catch(Exception e)
System.out.println("caught " + e);
}
Maybe you are looking for
-
IE has a simple means to delete both cookies and temporary files. I can delete cookies in FF but there is no way found to delete temporary files. This is a design feature flaw I assume since I cannot imagine this feature is not in the design..just ca
-
Loosing patience : I've tried for 2months to switch over to my new 4s, but every time I enter my apple ID to retrieve backup from icloud. I'm informed no back up available. Given tried for 2months, I'm tempted to bin it and get an alternative phone.
-
Hierarchy to use in Script Logic
Hello Experts I am trying to transfer the Profit/(Loss) from P&L to Reserve Account in the Balance Sheet by running a script logic. I am using BPC 10 NW 7.4 The hierarchy of P&L, is designed to calculate the Profit of Loss for the period. I wrote th
-
Help with LaserJet 1022 - Mac OS X
Please can someone help? I have been using the beloved 1022 for years now, and have managed to keep it going with Gutenprint etc. But a few days ago it started printing blank. All the drivers I can find online don't get it working. I've tried it on
-
Dreamweaver 13.1 OSX crashing on link creation. How Fix?
I am using DW 13.1 on OSX 10.9 and have continous crashing problems. Most recently, a repeatable crash on turning text into a link. Anyone have this problem and found a fix for it? thanks