RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (Full Version)

All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy



Message


somebody621 -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (6/28/2008 10:59:18)

Nicky, I think there's a property of hitTest that makes this possible. If I remember, it's like hitTest(x, y, true), though it only works for point vs mc, meaning it will only hittest if the other object is a point. You could work out a system, but there are many faster and more accurate options. Using math, the same is possible.

FLSG.DONT.KILL.ME.CAUSE.IM.NOT.SURE.ABOUT.THE.HITTEST.THING.SINCE.I.HAVENT.USED.IT.IN.A.WHILE




flsg -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (6/29/2008 10:13:45)

^ yeah that works too lol
but in AS3 I think it's hitTestObject for touching a MC, and hitTest for touching a point, and it's slightly diffrent.
currently they classed hitTest not as a movieclip method anymore, but as a bitmapdata method >_<
to hittest a point, you need to do like this:

var bd:BitmapData = new BitmapData(80, 80);//create a bitmapdata object, defines its dimensions
//hittest it with a point
trace(bd.hitTest(new Point(1, 1), 0xFF, new Point(30,30)))//returns true

where the first argument is a point object which defines the positions of the upper-left corner of that bitmapdata object you want to touch, the second argument is "The highest alpha channel value that is considered opaque for this hit test"(taken from the documentation), and the third is the second point you want to touch with the first object. Of course, I took the documentation's example, but in real coding you'll change the point object's values so that they correspond to the mc's x and y positions
the above code returns true, since the bitmapdatat object, at (1,1), stretch until (81, 81), which touches (30,30)

I think I just discouraged everyone here to learn AS3 ;_; I feel like talking to myself again...


Nicky: forget what I said about the hypothenuse thing, I just didnt want everyone to abuse hittest lol. But if it's really easier to do do with hittest, do it XD
also, if you think AS2 is easier, use mcName.hitTest(x,y,true) like somebody said.




Nicky -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (6/29/2008 21:23:52)

Alrighty, cool. Thanks guys... so many options XD.

I'll read through that and see what looks good. And yeah, AS3 does sound confusing now X3.

Naw. Thanks :P.




tauguy -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (6/30/2008 11:49:52)

quote:

Does anyone have any idea how I could make a camera-like thing in flash? As in, a photo taking camera not a camera that you look through (I have seen that tut). So the same thing as that, just it captures what is visible through the camera and can be called upon with the same capture later on.
I have one idea, but haven't tested it and have no idea if it would acutally work. All I know is the code would be very tricky...


Did this not get answered because nobody knew, or because it wasnt seen?
Doesn't matter, as long as I find out if it is possible in the end.




flsg -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (6/30/2008 22:24:16)

^sry didnt see that post
and yes, it is possible(no matter what you ask I'll say it's possible lol)
I strongly discourage you to do that, it's very complicated(VERY)
but here's the basic principe:
use bitmapdata and bitmap objects, use the build-in methods to shade the useless part by Action Script(not manually), then copy each pixel using bitmap's build in methods(forgot which one, gonna check my book later), and recreate the image




biG frend -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/1/2008 11:16:51)

Well flsg I was going on common sense, how can 1 object have more than one center?




tauguy -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/1/2008 15:43:16)

Right...that sounds complicated. My idea was that I code it so that the image is made up of small tiles. Each tile is asigned a variable. If the tile is covered by shading (either using hitTest or something else) the variable is false, if not it is true. The system saves the variables to the database when you 'take the photo' and can check them and reload the image you captured.

Would it work? Is the other way easier?




biG frend -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/1/2008 16:15:31)

It would be easier to use an array to store all that data otherwise it'd be pretty long job to do it.




tauguy -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/1/2008 16:17:21)

So instead of saving to the database I use an array? I'll find out what that is later lol...




biG frend -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/1/2008 16:18:53)

An array is a flash thing if you catch my drift their controlled through AS and you can use them with databases.




flsg -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/1/2008 18:16:09)

quote:

Well flsg I was going on common sense, how can 1 object have more than one center?

what? I never said that o.0

BTW where's the quote option >_<

Removed to stop quote pyramids. ~iChar




tauguy -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/2/2008 12:24:42)

Been removed so you have to copy n past into quote tags

Edit: Is there a reason this code won't work? It's supposed to be for a preloader. All it does at the moment is make the preloader all squashed up.

onClipEvent(load){
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded / bytes_total;
(this)._width = getPercent * 100;
if (bytes_loaded == bytes_total)
{
    (this)._visible == false;
}
}




flsg -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/2/2008 20:38:48)

load event? why isnt this in an enterframe event? >_<




EragonZZZZ -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/2/2008 21:28:07)

Hehe, yeah.

onClipEvent(load) is going to run once...when your clip actually loads.

onClipEvent(enterFrame) is going to run once every frame..which is what you want for any operation that runs continuously until done/other criteria (like updating a preloader).




tauguy -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/4/2008 13:10:31)

lol

Anyway I'm having trouble getting a button within a movieclip to controll something outside of the movieclip. Is there a different code to the usual

on(release){
gotoAndStop("XYZ");
}

?




flsg -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/4/2008 20:50:52)

you need to direct the gotoandstop to the corresponding object you want to control: _root.myMC1.gotoAndStop("XYZ")




tauguy -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/8/2008 13:27:35)

Stuck (again)

I can get a var to go up by 1 on a mouse press, but how would I get a var to go up steadily (once per second, for example) when the mouse is held down, and stop going up when the mouse if released?




Dragon. -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/8/2008 15:38:25)

i made a weapon in flash. what file type should i save it as?
i tried png and jpg but it says
"photogallery can't open this video or photo. the file may be unsupported, damaged or corrupted"
anyone help?


NOTE: there is no animation just the one pic of the weapon




tauguy -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/8/2008 15:53:38)

Try .swf (presuming your host supports it) failing that, .gif or failing that use a different host (imageshack.us, photobucket.com etc. etc.)
If that doesn't work try uploading an older file. If that works, try copying and pasting your weapon into a new flash document then uploading that. If it doesn't, someone else must have a solution!




Dragon. -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/8/2008 16:07:25)

im not worried about uploading yet its just that
i cant even view the picture in my pictures folder
on .gif .jpg .swf .png
and its my first thing made in flash, as i downloaded trial earlir




Dragon. -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/10/2008 11:18:48)

ok i made a second weapon in flash
saved as .fla .png and .swf
i can open the .fla but the other two come up
with the same mesage, someone please help!




TreadLight -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/10/2008 16:04:12)

This may be because you are going to the wrong places to view the files.

Try searching for the files on your entire system with the "Search" function. It should come up.

And when you do find the files, make sure you know where they are in. Try making a shortcut on your desktop for later use.




flsg -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/10/2008 19:48:58)

tauguy: eragon told you the onenterframe's use.

or if you prefer a simplier/more complex(depends how you see it), use setInterval, check the documentation for more infos(assuming you're using AS2 like EVERYONE ELSE here)




tauguy -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/12/2008 8:10:38)

I mean that the variable will go down continuously until the mouse is released. Eragon's solution doesn't help with this, but did help with what I wanted it to do.




EragonZZZZ -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (7/13/2008 16:24:11)

Geez, flsg, I'd use AS3 if I hadn't lost my copy of Flash 9 and the free beta of Flex 3 when my HARD DRIVE DIED.

Anyway...

tauguy, this situation requires a Boolean variable.

Basically, it's a variable that only has two values: "true" and "false"

Of course, the below code adds 1 per frame, so it'll add 24 or 12 or whatever in a second...but it's pretty easy to modify so it adds one per second.

var mousePressed:Boolean = false;
var num:Number = 0;

onClipEvent(enterFrame)
{
     if(mousePressed)
          num++;
}

onClipEvent(mouseDown)
{
     mousePressed = true;
}

onClipEvent(mouseUp)
{
     mousePressed = false;
}




Page: <<   < prev  6 7 [8] 9 10   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
0.125