How to add Event to every single pixel with BitmapData?
What I want to accomplish: when I drag the cursor over a sprite I want the sprite to break down and every single pixel moves through the screen at random x and y axis.
To make it simple the draw this is what I want but with much more fragments(pixels) around, thousands of them. How come could I approach this?
Thanks in advance.
if mc is the object whose pixels you want to randomize and display in a bitmap:
var bmpd:BitmapData = new BitmapData(mc.width,mc.height);
bmpd.draw(mc);
var bmp:Bitmap = new Bitmap(bmpd);
addChild(bmp);
mc.visible=false;
mc.addEventListener(MouseEvent.MOUSE_OVER,randomizeF);
function randomizeF():void{
var a:Array = [];
for(var x:int=1;x<=bmpd.width;x++){
for(var y:int=1;y<=bmpd.height;y++){
a.push(bmpd.getPixel32(x,y));
shuffle(a);
var i:int=0;
for(x=1;x<=bmpd.width;x++){
for(y=1;y<=bmpd.height;y++){
bmpd.setPixel32(x,y,a[i]);
i++;
function shuffle(a:Array) {
var p:int;
var t:*;
var ivar:int;
for (ivar = a.length-1; ivar>=0; ivar--) {
p=Math.floor((ivar+1)*Math.random());
t = a[ivar];
a[ivar] = a[p];
a[p] = t;
Similar Messages
-
Ipad 4 how to add event for every 4 weeks ios 7
This is a monthly appointment but it's on the same day at the same time. How can I add this to the calendar? Thanks.
I would also have a look at Pocket Informant, this is a significantly more sophisticated calendar / task manager than the inbuilt calendar but it does cost.....
I have used it for about 5 years both on the iPhone / I pad and an HX 4700 and it is just brilliant.
Xerxers -
How to copy and paste a single pixel
How to copy and paste a single pixel
I want to copy a single pixel and then paste it in the
position of
another pixel in the same image.
(This is in effect changing the colour of the target pixel,
isn't it.
But in my case copying an existing pixel seems simpler than
selecting a
colour from the swatch or using the colour picker.)
What is the most efficient way of doing this?
I tried to select one pixel with the marquee tool. Then
copied it with
control-C, but then how do I select the target pixel and
paste with
control-V?
Thanks for your help.
AdrianUse the Pencil Tool
alex
adrian stock wrote:
> How to copy and paste a single pixel
>
> I want to copy a single pixel and then paste it in the
position of
> another pixel in the same image.
>
> (This is in effect changing the colour of the target
pixel, isn't it.
> But in my case copying an existing pixel seems simpler
than selecting a
> colour from the swatch or using the colour picker.)
>
> What is the most efficient way of doing this?
>
> I tried to select one pixel with the marquee tool. Then
copied it with
> control-C, but then how do I select the target pixel and
paste with
> control-V?
>
> Thanks for your help.
>
> Adrian
> -
How to add event to calendar?
how to add event to calendar? No plus sign at top of window.
See the user guide: http://manuals.info.apple.com/en_US/iphone_user_guide.pdf
-
How to add a new field in MM01, with say contaminent as a field?
How to add a new field in MM01, with say contaminent as a field? I process that i know is i has to go the user exit and check out the three user exits that are available for MM01 after that what i have to do please can any one help me out with the procedure to proceed?
Hai venkateshwar reddy ,
try with these user exits
MGA00001 Material Master (Industry): Checks and Enhancements
MGA00002 Material Master (Industry): Number Assignment
MGA00003 Material Master (Industry and Retail): Number Display
Refer these steps also
http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/screen-exit-on-mm01-mm02-mm03-322717# -
How to add a scrolling text in portrait with iMovie
how to add a scrolling text in portrait with iMovie
This is how i was able to do it. Edit html source.
<div align="center"><marquee id='scroll_news4' bgcolor=#ff9966 "><font color="#000000" size="+1" ><strong>Outlook is down! IT is working on it! </strong></font></marquee></div>
<input type='Button' value='Stop' id ='b1' onClick='button_click()';>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function button_click()
if(document.getElementById('b1').value=="Start"){
document.getElementById('b1').value="Stop";
document.getElementById('scroll_news4').start();
}else{
document.getElementById('b1').value="Start";
document.getElementById('scroll_news4').stop();
// End -->
</script> -
Regarding : How to add a user to portal group with the help of webdynpro .
Hii ,
I am working on an application in which with the help of an action( Button) we r adding a user in Ztable in R/3 , as well as group in portal.
The user r successfully creating in Ztable but from portal side No user is assigned to Portal group.
I need coding solution for " How to add a user to portal group with help of webdynpro"
Any usefull link will also do.
Pls anyone have any solution ??
Thnks in advance.
Rewards r waiting for u .Hi,
Use UME api to add user to portal group.
Using UME API:
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40d562b7-1405-2a10-dfa3-b03148a9bd19
Regards,
Naga -
If you have many tabs open (in my case 30 tabs), you cannot click every single tab with your mouse, you can only reach them by opening the tab list at the right.
You can create a folder with the home pages by using "Bookmark All Tabs" to open a specific page.
You can place that folder on the bookmarks toolbar or use the Bookmarks menu button that you can find in the toolbar palette to get access to that folder easily.
* Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"
* "Bookmark All Tabs" can be accessed via the right-click context menu of a tab on the tab bar.
* "Bookmark This Page" can be accessed via the right-click context menu of that browser page. -
How can i split a long single video with many different scenes in it ?
how can i split a long single video with many different scenes in it ? in premiere pro cs3
Yep better ask in the Premeire Pro forums, but while loading their forum page check the cutter tool (C) it will allow you to cut your footage
-
How to add a SSD to 2010 iMac with 1tb drive
How to add a SSD to 2010 iMac with 1tb drive? I have a mid-2010 iMac with 1tb HD and would like to either replace the HD with SSD -or- add 256 or 400gb SSD to maybe the Optical Drive and use it as the boot drive. Is this possible with Model 11,2? i thought i\I'd read it was, but recently am reading my system is too old - OWC have SSD drives for newer models not Model 11,1 -or- 11,2
Any SATA SSD will work, whatever you are reading is incorrect.
You have 2 choices with this model-install the SSD in place of the HDD or the Superdrive.
If you are installing in place of Superdrive you will need some form of SSD Caddy-these can be found on the cheap at places like eBay, also OWC sell one called the DataDoubler.
Guide:https://www.ifixit.com/Guide/Installing+iMac+Intel+21.5-Inch+EMC+2389+Dual+Hard+ Drive/8643
If installing in place of old HDD you will notice that the propietary Temperature Sensor will not fit on the new drive, you will need to replace this with a sensor such as this or this
You will also need a 3.5inch to 2.5inch drive adaptor such as this
Guide: https://www.ifixit.com/Guide/iMac+Intel+21.5-Inch+EMC+2389+Hard+Drive+Replacemen t/6284
If you still have doubts contact OWC as mentioned above, I would start deciding whether your Superdive is needed or if you want to swap out the HDD.
Hope this points you in the right direction -
How to add bullet on every enter event in text field
Hello, Can someone please point me in the right direction. I am trying to add a bullet every time someone presses enter on the keyboard. this is within a textfield.
Thank you,
HowardHi
I would solve it by a script that checks your multiline field for newlines by ENTER key and insert "* " in the beginning of each line.
1) create a multiline field in your form
2) insert the script below in exit event... and enjoy the magic ;)
just 7 lines of code without comments. The split function is very powerful, I really use it alot now!
===== script start =====
//value of the field to insert "* " in each line
var sFldValue = this.rawValue;
//you split text in field for each '\r' = newLines made with enter
var tmpFldArray = sFldValue.split("\r");
//tmp string you concat your out text in
var sOutStr = "";
//for each line of text insert '* ' in beginning
for(var i = 0; i < tmpFldArray.length; i++){
//need to add '\r' because split removed it
sOutStr += "* " + tmpFldArray[i] + "\r";
//return manipulated string to your field
this.rawValue = sOutStr;
===== script end =====
/Thomas Groenbaek
Jyske Bank
Denmark -
Dots (events) for every single day in calendar (NEW issue)
Ever since I upgraded to FW 2.0 I have had "dots" appear in every single day of the calendar (symbolizing events) even though I have no events for those days.
Now - I KNOW about the issue with the recurring/repeating events as well as events that "begin" after they "end." That said, I have checked EVERY single event I have in the phone and in the calendar in Outlook and NONE of the events are repeating/recurring and all of them are set up properly with correct start/end times.
From my searching, the above seems to be what's commonly known to cause this problem. Those don't fit MY problem.
The odd thing here is, if I go backward in the month view on the calendar on the phone to February, there are no dots. There are also no events. However, if I go to March on the month view in the calendar, every single day has dots (and continues). The really weird thing here is if you look at the calendar in the month view while it's on March, you can see the last week of February at the top. And in that last week, while in the "March" view, the last week of February ALL has dots. But again, if you move back to "February," all those dots that were there disappear.
So...I'm at a loss now. I've wiped the events off the phone. Edited/pruned/etc. events in the Outlook calendar, and then re-synced with the order to overwrite that which is on the phone. Still no luck. Is this a glitch that needs to be corrected with new FW? Would a restore help? I just don't really know anymore..
Thanks,
JohnI am having the same issue. However, I am syncing my calendar to my work computer and the issue presented itself when I upgraded to Office 2007 from 2003. I have since removed Office '07 and did a restore to my iphone which cleared the issue. Then did a sync again to Office 2003 and the issue re-appeared. Not sure if '07 added something to my calendar that is hidden but it is very frustrating.
-
Hi Experts, oo hierarchical alv, how to add checkbox on every header?
Hi Experts,
I am working on oo hierarchical alv, how can I add checkbox on every header? thanks in advance!
Kind regards
DawsonHi Dawson,
Just refer the below program & pass the check box functionality (mentioned in bold) in REUSE_ALV_HIERSEQ_LIST_DISPLAY in your program.
TYPE-POOLS : slis.
Data
DATA : BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE t001.
DATA : flag tyPE c,
END OF itab.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvly TYPE slis_layout_alv.
Select Data
SELECT * FROM t001 INTO TABLE itab.
*------- Field Catalogue
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITAB'
i_inclname = sy-repid
CHANGING
ct_fieldcat = alvfc
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
Display
alvly-box_fieldname = 'FLAG'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = alvfc
i_callback_program = sy-repid "<-------Important
i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important
is_layout = alvly
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
CALL BACK FORM
FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
slis_selfield.
LOOP AT itab.
itab-flag = 'X'.
MODIFY itab.
ENDLOOP.
IMPORTANT.
WHATROW-REFRESH = 'X'.
ENDFORM. "ITAB_user_command
Regards
Abhii... -
How to add events in JTable fields
Hello friends i m working with file transfer client server project in my college.In my client part i have used JTable with AbstractTableModel.
In my JTable it list the current directory files and directories under current directory .
now how can i add events to the the directories that it shows on JTable so that when i click on directory it displays files under that selected directory.
can anyone help me in that.
I will send you my code for that project if anyone can help me.
please help me to do thatYou can handle row selections with selection listener but if you want to handle double clicks you can use something similar to this:
table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e)
int column = table.columnAtPoint(e.getPoint());
int row = table.rowAtPoint(e.getPoint());
Object cellValue = table.getValueAt(row, column);
// Insert files below clicked row
});Please, be more patient in the future -you would probably get an answer if you just posted to any of these two forums. -
How to add event listener?
i want to add event listener when i click on a button in mxml, the event listener should be added in the action script file, how to do this?
can anyone help? urgent!!!Hi Lakshmi,
You can do this just put all the script in the mxml block in seperate AS file as shown below... Observe that I have included an AS file named Script.as and removed the script block form mxml and moved to this Script.as file. Place the Script.as file in your src folder ....
// Main mxml file....
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="onCreationComplete()">
<mx:Script source="Script.as"/>
<mx:TextArea id="textArea" width="300" height="100" />
<mx:Button id="myButton" label="Click ME"/>
</mx:Application>
//Script.as file
import mx.controls.Alert;
private function onCreationComplete():void
myButton.addEventListener(MouseEvent.CLICK, onButtonClick);
private function onButtonClick(event:MouseEvent):void
Alert.show("Button is Clicked");
Thanks,
Bhasker
Maybe you are looking for
-
Multiple page PDF's for iTunes playlists
In the past I've been able to create multiple page PDF's of playlists, but for some reason in iTunes 10.1 it will only show me the first page. At the bottom of that page it'll say page 1 of 10, but the other 9 pages do not appear in the sidebar. I al
-
I am trying to update my apps and iTunes keeps asking for my security code on my CC. I enter the new info and it still says invalid. Help
-
Sorry for the dramatics... My camera, my lovely Canon 5Dm3 is randomly and occasionally inserting nasty dropouts. I didn't even know that was possible on solid media! I'm using Transcend 1000x CF cards, but periodically, I get a really nasty glitch t
-
Everytime that I attempt to restart or shutdown my iMac 27", it freezes with the spinning wheel. Is there a log file that I can review that will show me the process or application that is hanging that is preculding the proper shutdown or restart?
-
Problem, configuring Wi-Fi in Cisco851W
I need to configure my Cisco851W, using WEP encryption with SSID, which anyone can find in wireless network neigborhood.(with Broadcast SSID in Beacon in terms of Cisco) I am trying to do this simple thing using Wireless Application. I input name of