Home  | Login  | Register  | Help  | Play 

RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul

 
Logged in as: Guest
  Printable Version
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul
Page 8 of 18«<678910>»
Forum Login
Message << Older Topic   Newer Topic >>
6/28/2008 10:59:18   
somebody621
Member

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
Post #: 176
6/29/2008 10:13:45   
flsg
Member

^ 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.

_____________________________

My flash gallery
my game thread

flsg, proud old member of AQ(still playing :O)
AQ  Post #: 177
6/29/2008 21:23:52   
Nicky
Member

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.
AQ DF  Post #: 178
6/30/2008 11:49:52   
tauguy
Member

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.
AQ  Post #: 179
6/30/2008 22:24:16   
flsg
Member

^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
AQ  Post #: 180
7/1/2008 11:16:51   
biG frend
Member

Well flsg I was going on common sense, how can 1 object have more than one center?
AQ DF MQ  Post #: 181
7/1/2008 15:43:16   
tauguy
Member

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?
AQ  Post #: 182
7/1/2008 16:15:31   
biG frend
Member

It would be easier to use an array to store all that data otherwise it'd be pretty long job to do it.
AQ DF MQ  Post #: 183
7/1/2008 16:17:21   
tauguy
Member

So instead of saving to the database I use an array? I'll find out what that is later lol...
AQ  Post #: 184
7/1/2008 16:18:53   
biG frend
Member

An array is a flash thing if you catch my drift their controlled through AS and you can use them with databases.
AQ DF MQ  Post #: 185
7/1/2008 18:16:09   
flsg
Member

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

< Message edited by iChar -- 7/2/2008 20:51:58 >
AQ  Post #: 186
7/2/2008 12:24:42   
tauguy
Member

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;
}
}


< Message edited by tauguy -- 7/2/2008 13:06:10 >
AQ  Post #: 187
7/2/2008 20:38:48   
flsg
Member

load event? why isnt this in an enterframe event? >_<
AQ  Post #: 188
7/2/2008 21:28:07   
EragonZZZZ
Member

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).
AQ  Post #: 189
7/4/2008 13:10:31   
tauguy
Member

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");
}

?
AQ  Post #: 190
7/4/2008 20:50:52   
flsg
Member

you need to direct the gotoandstop to the corresponding object you want to control: _root.myMC1.gotoAndStop("XYZ")
AQ  Post #: 191
7/8/2008 13:27:35   
tauguy
Member

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?
AQ  Post #: 192
7/8/2008 15:38:25   
Dragon.
UCaG Contest Winner Feb 09


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
Post #: 193
7/8/2008 15:53:38   
tauguy
Member

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!
AQ  Post #: 194
7/8/2008 16:07:25   
Dragon.
UCaG Contest Winner Feb 09


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
Post #: 195
7/10/2008 11:18:48   
Dragon.
UCaG Contest Winner Feb 09


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!
Post #: 196
7/10/2008 16:04:12   
TreadLight
Member
 

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.
MQ AQW Epic  Post #: 197
7/10/2008 19:48:58   
flsg
Member

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)
AQ  Post #: 198
7/12/2008 8:10:38   
tauguy
Member

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.
AQ  Post #: 199
7/13/2008 16:24:11   
EragonZZZZ
Member

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;
}
AQ  Post #: 200
Page:   <<   < prev  6 7 [8] 9 10   next >   >>
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul
Page 8 of 18«<678910>»
Jump to:



Advertisement




Icon Legend
New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts




Forum Content Copyright © 2018 Artix Entertainment, LLC.

"AdventureQuest", "DragonFable", "MechQuest", "EpicDuel", "BattleOn.com", "AdventureQuest Worlds", "Artix Entertainment"
and all game character names are either trademarks or registered trademarks of Artix Entertainment, LLC. All rights are reserved.
PRIVACY POLICY


Forum Software © ASPPlayground.NET Advanced Edition