Flash Actionscript Help?
17 years ago
I'm trying to figure out how to code a feature for an app I'm trying to make. Basically, all I need is some actionscript that will let a user click on an object(symbol) and by dragging the mouse up, it makes the object larger, and dragging the mouse down makes the object smaller. When the user unclicks the object, it stays at the size the user set it to. Any help would be greatly appreciated, thank you =)
http://www.toxiclab.org/tutorial.asp?ID=70
And this:
http://www.toxiclab.org/tutorial.asp?ID=133.
I've tried to figure out how to combine them to do what I need, but I'm by far not a programmer, lol.
ummm not exactly what your looking for but may help.
You can also create a text inpute box that would allow people to set the size by a percentage. You can just set the program to scale to the data inputed.
Glad you found what you needed :)
*Continues to struggle with making simple buttons and preloaders*
Once you understand how the answer to \"did you eat a sandwich or did you have soup?\" is \"yes,\" despite the irritation of family members around you when you answer thus, regardless of what you actually DID eat (provided that soup or sandwich was involved), then you can code.
Also, Real Programmers Use Butterflies.
onClipEvent(load){
objectheight = this._height
}
on(press){
if(_root._ymouse<this._y || _root._ymouse>this._y){
heightdifference = (_root._ymouse-this._y)
}
}
on(release){
newheight += heightdifference
}
onClipEvent(enterFrame){
this._height= this._width + newheight
}
/**/
This might work to what you're looking for, but it change in size would only work when you let go.
Good on you Athus for persisting with Flash!
while dragging: Each frame store the y, and compare to last stored value. If it is different, change scale accordingly
on mousdown (or the clicking of an underlying button), check mousey(positive or negative) or root.mousey (absolute) and move/scale accordingly (like clicking on the scroll bar)
make the file 100 pixels and set scale=y every frame >.> (or scale=(y*100)/root.height)
onClipEvent(enterFrame) scale+= Math.round(Math.random() * 2) - 1; //This'll work Ah swears.
map the arrow keys to y/scale in the keymapping method of your choice?
Eat a pretzel bite, rinse, repeat.
Make an array of objects, each slightly larger than the next, positioned in ascending order, and have root change their .visible according to mousey in the most confusing yet technically correct way possible.
Create a line of one pixel tall buttons that have increasingly big objects in their hover/click frames
predict the user's desired motions and hand-draw each frame so that it looks like they're controlling the object.
build a brain implant that is USB2 compatible, and map four of the input bytes to an increase and decrease in y and scale, and then stand behind the user and control the object for them so that they look like they have control.