Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




User Being Able To Colour In Objects



I am creating a kids program using flash. I want to have a section that lets kids colour in objects, like cars and stuff. How do i go about doing something like this, can someone provide me with a simple example, say a circle, and then a choice of colours, letting the user select a colour and then click on the circle to color it.

Any help would be apprciated!



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 01-26-2004, 01:46 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

User Being Able To Colour In Objects
I am creating a kids program using flash. I want to have a section that lets kids colour in objects, like cars and stuff. How do i go about doing something like this, can someone provide me with a simple example, say a circle, and then a choice of colours, letting the user select a colour and then click on the circle to color it.

Any help would be apprciated!

Creating A Colour Dialogue Box For User To Select A Colour For Background.
Hi,
Any ideas how to create a colour dialogue box so the user can select their own pereference of background colour?
thx
shaf
(I mean inside the SWF as its running......)

User Defined Colour Scheme
Ok people here is something to really challenge you Flash gurus. Im not even sure this is possible but Ive no doubt that if it is this is the place to find out! Anyway what I am tying to do is have a user defined interface so at the start the user chooses what colour background they want (which is definately possible, check out www.bda.co.uk for proof) and also what colour boxes there are etc. What im wondering is if there is any action script or other methods for changing the colours of symbols? perhaps some kind of tint command or something better! Any ideas would be great but like i said im not even sure this is possible!

Many thanks
Croogish
www.kormagraphics.com

Colour Objects Associated With Multiple Mc's
can i associate one colour object to many mc's?


eg:

b1colour = new color (b1 , s1 )

seems logical?

Let User Interactively Changing Font Style, Size, Colour
hi folks,

is anyone able to advise whether it is 'easily' do-able to script in Flash AS2 so that a user is able to determine the font style, colour, size of dynamic text interactively?

I've put together an app that works fine but now I'd like to provide the option for the user to choose/skin the font of the dynamic text in the displayed material 'cuz this would strengthen their learning experience when using the app.

thanx for your time in responding.

pax.

Getting The Colour Of Objects During Design Time
Hi I'm having a really basic problem...

When I'm designing my movies in MX, if I select an object be it a line or a shape, the line and fill colours in the tools and colour panels do not update with the selected colour making it difficult for me to find what colour they actually are. Worse still if I've spent a long time getting the right gradient or radial fill on a shape then I can't get the details to appear in the fill colour on selecting, meaning that if I need to make a change I have to start over again. Anyone else having this trouble? Is it me being a dumbass? Is it just that MM have changed the way you do this?

Any help would be greatly appreciated

Thanks

Saving Colour With Shared Objects?
Hi,

I am developing a uk map application that all the regions colours can be changed.

So far so good, the problem i'm having is trying to get each region to save to a SO so that when the .swf is next opened the changed regions keep their colour.

Any help on saving a MC's colour would be much appreciated.

Thanks,

Phil

Make Colour/font/size Menus Display For User Selection
hi folks,

with AS2 is it possible to make the 'embedded' Flash colour swatch/mixer appear, while an app is running, so that a user can interactively select their choice of colour and have it applied to a screen object? IF yes, how is the colour swatch/mixer made to appear?

similarly, is it possible to have the 'embedded' Flash fonts menu be displayed by a user for their selection of font?

also, font size menu?

font style selection I'm not worried about.

many thanks.

User Objects In MX ActionScript
Hi,

I'm not the greatest ActionScripter in the world, so I need help. I have an ActiveX component, which I would like to rewrite in ActionScript. I want all the Properties and Methods to be basically the same as the Component. So I want to create an Object in ActionScript. This is what I have so far (I just started):

Code:
new Object('MyComponent');
var m_server = 'www.myServer.com';
function MyComponent() {
this.addProperty('Server', this.getServer, this.setServer);
this.watch ('Server', setServer);
function setServer(id, oldval, newval) {
m_server = newval;
}
}

but I don't understand how the callback part in the this.watch works. Could someone explain or give me a URL. The flash help isn't helping too much. I don't even know if the above code works. The syntax check says there are no errors, but I can't seem to retrieve the Server Property.

User Updatesing Objects
I hope this is a simple question. If I create an object, how can I let the user change the properties? For example, if I have:

code: personB = new Object();
personB.ab = 10;
personB.h = 5;
personB.bb = 1;

I want the user to be able to input the value. So, if the user wants to update the value of personB.h by two, how can I accomplish this with an input box. If I create an input box with the variable name of bhits, how would I let the user submit the changes to update that value?

Would I do something like this?

code: bhits = personB.h = bhits + personB.h

I don't have flash in front of me right now, so I can't even check

Your help is much appreciated.

User Shapeable Objects
how do i make a shape have draggable bounds? I want to make something like a thing where you can drag the boundaries of, say, an 'O' and make it look like a 'D' by dragging it. it is really confusing me, and i don't know what to do!

User Controlled Objects *HELP Please*
Hi, so heres what I want to do. I want to let the user control an object, in this case a cartoon character blowing a bubble. I want the user to be able to control the bubble by rapidly clicking their mouse. The faster they click the bigger it gets and when they dont click or click slowly the bubble gets smaller in size.

The only tutorial Ive found that is similar is this http://www.kirupa.com/developer/mx/gamecontrols.htm

Anyone point me in the right direction of a tutorial closer to what im trying to do?

Thanks!

User Controlled Objects *HELP Please*
Hi, so heres what I want to do. I want to let the user control an object, in this case a cartoon character blowing a bubble. I want the user to be able to control the bubble by rapidly clicking their mouse. The faster they click the bigger it gets and when they dont click or click slowly the bubble gets smaller in size.

The only tutorial Ive found that is similar is this http://www.kirupa.com/developer/mx/gamecontrols.htm

Anyone point me in the right direction of a tutorial closer to what im trying to do?

Thanks!

Please Help Shared Objects As User Passwords
hey guys...i am totally stumped on this one...here goes:

flash site that has a login screen...i used Shared Objects to allow the user to save their password when they visit the site (like cookies)...this all works fine...however, to save you all from an exhaustive explanaition of why i did this, there is a log-in page for EVERY individual page on the site (there's roughly 20 in all).

this way, when the user clicks Log In, it takes them to the specific page they are requesting, instead of just defaulting to the home page (god i hope that made sense).

so here's the issue:
for some reason the user info is only being saved on a page-by-page basis...meaning, that if the user clicks to the photos page, logs in and then closes their window...then later, clicks to some other page, their info is not retrieved on this new page...

i understand that i am using different flash files for each log in page, but its the same script referencing the same shared object (which from what i see creates a .txt file), so it seems like it should work

here is the code:

first frame:

Code:
stop();
user_so = SharedObject.getLocal("user");
if(user_so.data.tname != undefined) {
gotoAndStop(20);
}
on frame 20 (labeled save data):

Code:
name_txt.text = user_so.data.tname;
on the save data button:

Code:
on(release) {
user_so.data.tname = name_txt.text;
gotoAndStop(20);
}
finally, on the last frame which takes them into the site:

Code:
stop();
password = inputName;
if (password == "flashkit") {
inputStatus = "Thank You for Logging In!";
_root.contentLoader.unloadMovie();
_root.stageContainer.ease(405, 845, "pages/06_01.swf");
_root.subnavLoader.attachMovie("subNav6", "subNav6_mc", 1);
_root.subnavLoader.gotoAndStop(2);
} else {
inputStatus = "Please Try Again";
}
the tutorial i followed is found here:
http://www.kirupa.com/developer/acti...ed_objects.htm

basically i just can't figure out how to allow the user to save this password once, and then flash pulls from this data no matter which page they are accessing the site from

so sorry for long post i am just at a total loss right now...thanks so much for your time!

Shared Objects As User Passwords
hey guys...i am totally stumped on this one...here goes:

flash site that has a login screen...i used Shared Objects to allow the user to save their password when they visit the site (like cookies)...this all works fine...however, to save you all from an exhaustive explanaition of why i did this, there is a log-in page for EVERY individual page on the site (there's roughly 20 in all).

this way, when the user clicks Log In, it takes them to the specific page they are requesting, instead of just defaulting to the home page (god i hope that made sense).

so here's the issue:
for some reason the user info is only being saved on a page-by-page basis...meaning, that if the user clicks to the photos page, logs in and then closes their window...then later, clicks to some other page, their info is not retrieved on this new page...

i understand that i am using different flash files for each log in page, but its the same script referencing the same shared object (which from what i see creates a .txt file), so it seems like it should work

here is the code:

first frame:

Code:
stop();
user_so = SharedObject.getLocal("user");
if(user_so.data.tname != undefined) {
gotoAndStop(20);
}
on frame 20 (labeled save data):

Code:
name_txt.text = user_so.data.tname;
on the save data button:

Code:
on(release) {
user_so.data.tname = name_txt.text;
gotoAndStop(20);
}
finally, on the last frame which takes them into the site:

Code:
stop();
password = inputName;
if (password == "password") {
inputStatus = "Thank You for Logging In!";
_root.contentLoader.unloadMovie();
_root.stageContainer.ease(405, 845, "pages/06_01.swf");
_root.subnavLoader.attachMovie("subNav6", "subNav6_mc", 1);
_root.subnavLoader.gotoAndStop(2);
} else {
inputStatus = "Please Try Again";
}
the tutorial i followed is found here:
http://www.kirupa.com/developer/acti...ed_objects.htm

basically i just can't figure out how to allow the user to save this password once, and then flash pulls from this data no matter which page they are accessing the site from

so sorry for long post i am just at a total loss right now...thanks so much for your time!

Please Help Shared Objects As User Passwords
hey guys...i am totally stumped on this one...here goes:

flash site that has a login screen...i used Shared Objects to allow the user to save their password when they visit the site (like cookies)...this all works fine...however, to save you all from an exhaustive explanaition of why i did this, there is a log-in page for EVERY individual page on the site (there's roughly 20 in all).

this way, when the user clicks Log In, it takes them to the specific page they are requesting, instead of just defaulting to the home page (god i hope that made sense).

so here's the issue:
for some reason the user info is only being saved on a page-by-page basis...meaning, that if the user clicks to the photos page, logs in and then closes their window...then later, clicks to some other page, their info is not retrieved on this new page...

i understand that i am using different flash files for each log in page, but its the same script referencing the same shared object (which from what i see creates a .txt file), so it seems like it should work

here is the code:

first frame:

Code:
stop();
user_so = SharedObject.getLocal("user");
if(user_so.data.tname != undefined) {
gotoAndStop(20);
}
on frame 20 (labeled save data):

Code:
name_txt.text = user_so.data.tname;
on the save data button:

Code:
on(release) {
user_so.data.tname = name_txt.text;
gotoAndStop(20);
}
finally, on the last frame which takes them into the site:

Code:
stop();
password = inputName;
if (password == "kirupa") {
inputStatus = "Thank You for Logging In!";
_root.contentLoader.unloadMovie();
_root.stageContainer.ease(405, 845, "pages/06_01.swf");
_root.subnavLoader.attachMovie("subNav6", "subNav6_mc", 1);
_root.subnavLoader.gotoAndStop(2);
} else {
inputStatus = "Please Try Again";
}
the tutorial i followed is found here:
http://www.kirupa.com/developer/actionscript/shared_objects.htm

basically i just can't figure out how to allow the user to save this password once, and then flash pulls from this data no matter which page they are accessing the site from

so sorry for long post i am just at a total loss right now...thanks so much for your time!

User Scalable Objects In Flash
I'm trying to figure out a way to make objects in flash that can be scaled and or rotated by the user when in my website. Can anyone help, any suggestions will be greatly appreciated.

HELP How 2 Direct User To New Scene Once All Objects Have Been Found
Hey Flashies,

I've got an inventory for my game. What I want to do is once the player has found all the objects in the inventory, to direct the player to the last scene in the game. How do I go about doing this?? All help appreciated (:

Help With Shared Objects In MX- Easy For Advanced User
Hi,

I'm currently designing a website which uses Flash MX animations to explain basic mathermaticals concepts to kids. There are about 20 of these ranging from fractions to multiplication etc. At the end of each one are some preset questions. What I want to do is to send a cookie/shared object to the user's computer which remember's each one they have done, and then when they log onto the site, suggest possible ones that they havent done. How could I do this?

I had a thought that you could somehow each one they have done (when parsing the cookie) into an array, check each one against the array of all possible animations, then pick 3 at random from that array, and play certain movie clips accordingly. Can anyone think of a better idea- help would be much appreciated as I'm quite new to Flash at the moment!

Many thanks

Chimpo

Help With Shared Objects Needed (easy For Advanced User)
Hi,

I'm currently designing a websitr which uses Flash MX animations to explain basic mathermaticals concepts to kids. There are about 20 of these ranging from fractions to multiplication etc. At the end of each one are some preset questions. What I want to do is to send a cookie/shared object to the user's computer which remember's each one they have done, and then when they log onto the site, suggest possible ones that they havent done. How could I do this?

I had a thought that you could somehow each one they have done (when parsing the cookie) into an array, check each one against the array of all possible animations, then pick 3 at random from that array, and play certain movie clips accordingly. Can anyone think of a better idea- hlp would be much appreciated as I'm quite new to Flash at the moment!

Many thanks

Chimpo

Trying To Make Multiple Objects Appear Based On User Input
allright I need to create a program which does the following:


There will be N obstacles on the screen, where N will be entered by the player. Three fourths, floor(N * 3 / 4), of these obstacles will be barriers that your avatar just bounces off and the remainder are forbidden obstacles (black-balls, poppies, democrats, republicans...). If your avatar hits a forbidden obstacle the game ends, you lose. These obstacles should be placed randomly on the playing field and all obstacles should be fully contained within the field. You game should have three phases:

Start Phase. Here you ask the user for two inputs: how many obstacles they want and the speed of their avatar. When they have entered both numbers and push a start button the number of obstacles the game moves to phase 2. Note, you should make sure that both numbers are entered before moving to phase 2, and if not prompt the user again to enter both.

Play Phase. Here the user needs to move their avatar from start to finish without hitting a forbidden obstacle. You need to time how long it takes the player to complete the task. Once the avatar makes it to the end location, or once they hit a forbidden obstacle, the game moves to phase 3.

End Phase. Here there is a message that they lost if they hit a forbidden obstacle or the time it took them to complete the task. They should also be given an option (and button) to play again, which moves them back to the start phase so they can reset input parameters

I have written some of the code for it already, but I can't get the portion which creates multiple obstacles to vary based on user input. I also can't get a 1/4 of the obstacles which show up to stop game play if touched.

here's the code which I have so far for creating multiple obstacles:

var obstacles:Number = bx_obstacles ; // stores amount of obstacles a user wants as a number

var numRectangle:Number = obstacles ;
var therectangle:MovieClip ;
var evilrectangle:MovieClip ;
var i: Number;
if i < (obstacles * 3/4)(
For( i = 0, i < numRectangle, i++)(
evilrectangle = attachMovie("rectangle2", r + 1, i)
evilrectangle._x =Math.random() ;
evilrectangle._y =Math.random() ;
trace( evilrectangle) ;
)

Else

For( i = 0, i < numRectangle, i++)(
therectangle = attachMovie("rectangle", r + 1, i)
therectangle._x =Math.random() ;
therectangle._y =Math.random() ;
trace( therectangle) ;

)
)

this is what it looks like now.
before i was using this which would only draw the rectangles which do not stop the game, but it would only draw it in one location.

For( i = 0, i < numrectangle, i++)
therectangle = attachMovie("rectangle", r + 1, i)
therectangle._x =Math.random() ;
therectangle._y =Math.random() ;

trace( therectangle) ;

User Interface - Can't Select Objects By Clicking Layer Like In Flash 5?
Is there a way to click a layer to select the object on that layer and see its properties? You can click a layer in MX, and the object or objects will be selected so that you can move them...but their properties don't display in the properties panel. The only way to pull up the properties seems to be to click the actual movie clip. This is extremely annoying when the movieclip may be invisible in its first frame. Often when I work with co-workers' movies, I want to find out the name of a movieclip...so in Flash 5 I would click a layer and I could find out the name of the clip by looking at its properties. Not so in Flash MX...I'm left trying to click the little crosshairs of an invisible movie.

So whenever I can...I save MX files down to Flash 5...and then use Flash 5. Anyone know of a way to fix MX's annoying user interface?

16 Bit Colour Mode Problem With Alpha Fades On Colour
Please help me out. I have tried many other forums and people, but no one can give me an answer. Hopefully you can.

Have a look at a site I designed for a school.

http://www.brineleas.co.uk in 32-bit mode this is great, now try 16 bit colour mode and you will see my problem.

Please help if you know how

Trev:

FMX: Save User-drawn Objects And Save/load DXF/DWG?
Hey everyone. Sorry to seem like a leech, but I could really use the guidance. Usually I'm pretty good for finding the solution on my own without having to trouble people, but this time I seem to be coming up short. So thanks in advance for taking the time to read this.

I'm developing an auto-cad esque flash application (going good so far too). I have no problem storing object information in a database (xy coordinates, rotation, scale etc), but now my problem is converting that data to another format; specifically DXF or DWG. Now I know the flash environment itself can import/export DXF's, but I don't know how to load the user-made data into the environment. Is it possible to have the environment run actionscripts to build these user-made objects and then manually save that to a DXF? (or even better would be a save/load DXF from the flash player)

Essentially I'd need to know if it's possible for the flash environment to read from my database (probably from reading a PHP built XML file), execute actionscript to reconstruct any objects created, and then let me go and manually (or automatically!) export a DXF of that.

Any comments or help would be greatly appreciated =]


EDIT:

The other very viable alternative is if you guys know of an XML to/from DXF/DWG converter.

Flash Shared User Objects (Flash 8)
Okay, so I have a color bar movie clip.
It has five colors and the colors change the background color.

What I want to know is how to see (with actionscript) which frame the background (a movie clip) is on, so it remembers which color they selected. I would like to use Shared User Objects for this. I have tried and tried (for about 3 hours), but no success.


Thanks in advance...

Flash Colour/ Javascript Colour
Can anyone over here help with the following...

http://www.were-here.com/forums/show...hreadid=148509

Colour Picker / Colour Transform
Hi...

This query has been bugging me for a little while, and it may be easy to answer, I don't know.

I'm using a fairly simple colour transform script to change the tint of a mc...
code:
myColor = new Color(_root.bgdvideo);
if(!ccc){_root.bgdvideo.setRGB(0x990000);
}else{
myColor.setRGB(ccc);
}
MovieClip.prototype.beginFade = function(dstX, durationOfFade) {
this.myColor = new Color(this);
this.srcX = this.myColor.getTransform();
this.dstX = dstX;
this.startOfFade = getTimer();
this.durationOfFade = durationOfFade;
this.onEnterFrame = function() {
var r = (getTimer()-this.startOfFade)/this.durationOfFade;
if (r>1) {
r = 1;
this.onEnterFrame = null;
}
var tX = {ra:this.srcX.ra*(1-r)+this.dstX.ra*r, rb:this.srcX.rb*(1-r)+this.dstX.rb*r, ga:this.srcX.ga*(1-r)+this.dstX.ga*r, gb:this.srcX.gb*(1-r)+this.dstX.gb*r, ba:this.srcX.ba*(1-r)+this.dstX.ba*r, bb:this.srcX.bb*(1-r)+this.dstX.bb*r, aa:this.srcX.aa*(1-r)+this.dstX.aa*r, ab:this.srcX.ab*(1-r)+this.dstX.ab*r};
this.myColor.setTransform(tX);
ccc = this.myColor.getRGB();
};
};

I know you have to change the ra, rb, (etc) values to alter the colour which you get (as in)...
code:
_root.bgdvideo.beginFade({ra:50, rb:204, ga:0, gb:0, ba:50, bb:255, aa:100, ab:100}, 1000);
...but I wondered if anyone knows a trick / way to find out the values you'd put in for (ra, rb, etc) to get a particular colour, rather than just aimlessly playing around with different values until you get the desired colour fade you want (which takes some time for me!)

Cheers
Jeff
*sorry if this is a dumb question...

A Colour Palette For Colour Matching
I'm new to actionscript and trying to creating a pretty simple colour palette which can let users to choose up to 8 different colours. First of all users will be presented with a range of different shades, and each time they choose a colour it can be saved to a movie clip, so finally they will have all 8 movie clips showing all the colours they've chosen.

The way I do is create a movie clip that contain all the colour shades in the palette in different frames. Then make 8 copies of it and give them different instance names. When the user come to select a colour then the movie clip will change to that colour, keep it, then the other colour will go to the second movie clip... and so on... I've tried different ways to simulate the saving function but it still doesn't work (one of them is using if / else statement on the button and declare different Number value on the movie clips)

Pls bare with me if my explaination is not clear... but any help will be greatly appreciated!! Pls tell me if you got idea how to do it or any similar work that you've done. I can also email / msn the file if you wanna have a look. Thanks in advance!! vinkc@hotmail.com

User Levels, Cell Phones, And User Registration, Plus Cookies
I need to quote a client on the following and need to know how much work is involved, ie hours. The programming may be done in PHP (unless its easier to do it all with AS), and the so the .swf needs
to talk to other files on the server.

Requirments are as follows:

1. contact form that: validate form, generate email, generate SMS for cell phones

2. registration form that: validates form, checks record, stores record if new, creates and sets cookie so they don't have to login next time, re-directs to appropriate page, sends email confirmation, deletes record if bad.

3. "extranet": validate i/p, check group (user level), send to user group destination


I just need to know if this is a simple couple thousand dollar thing or a complex many thousand dollar thing.

I can't guarantee anything (I don't write the cheques around here), and depending on the complexity of it we may be looking to subcontract some of it out.

Email me directly at: jonny@northstudio.com if you can be of any help.

Store And Retrieve Array Of Custom Class Objects From Shared Objects.
Hi,

I am stuck up with a problem in ActionScript 2. I am using Flash MX 2004 on windows XP.

I have created 3 custom classes say Parent, Child, and GrandChild. Parent class contains in it an array of its Child objects. Similarly each Child object contains in it an array of GrandChild objects. Also I do have one global array of all the Parent objects.

I want to store this array to the shared objects on specific events(say exiting the session) and then reload them from the shared object(on next session startup). I am able to store the global array to the shared object but when I try to retrieve the same array from shared object, I could not do it. The retrieved array is not of my custom class type [Parent].

Help needed to solve this problem urgently. Does anybody have idea how to do it??

Thanks in advance.



Cheers,
Naishadh Sevalia

Objects Talking To Objects, Parent/child Communication, Scope
I've been using AS3 at an intermediate level, and am getting deeper
into classes. I'm loving classes! I'm just cloudy on a few general
concepts.

It's easy for me to create a child object from a parent object, like a
ship in space for example (not working with ships right now but seems
fun to talk about). I can then navigate the ship from the parent
object.

What happens if the ship's engine temperature reaches critical? Is it
wise to dispatch a ship event that tells space that my ship is nearly
scrap? Or do I periodically query the temperature amount of the ship
from space? To me an event sounds like the solution, but I remember
hearing somewhere that parent objects should only talk to child
objects, not the other way around. Is this true?

Could I trouble someone for a basic example of how you would make this
communication work best?

Thanks for the assist. I'll post if I find anything interesting in
the meantime.

How Do I Reference Objects Inside Of Exported Library Objects ?
Hi,

I am having trouble figuring out what seems to be a simple fix? I have created a movieClip in Flash that contains 3 button clips. I want all to be accessible to actionscript, so I gave the movieClip and the 3 buttons a Linkage Identifier. I deleted them from the stage.

In actionscript, I have instantiated the movieClip and, thankfully, the buttons inside went along.

The trouble I'm having is figuring out how to target those buttons. Since they're on the stage already, I shouldn't have to create a new instance right? When I trace the buttons I get an undefined return in the out put.

Anybody know this one??

Thanks for the help!

Brian

Depth And Dynamic Objects/Attaching Scripts To Objects
I am having some problems with my Flash MMORPG created in Actionscript 3.0 that I am working on, not really errors, but more how to do something, in theory. I have 2 problems. First, my game is at a 45 degree angle, so it requires some depth handling(like one object is over another object when it should be behind that object). I am not sure how to go about this. I was thinking that each object's depth should be it's y position if it's origin was at it's feet. But that idea didn't go well, because the depth is limited by the number of children. What is the average way to do this? Next, I am trying to make dynamic objects, so that all I would do is copy and paste an object, or create a new class of it and it would work. What I mean is, the character checks a collision for each object, but if I copy the object with the same name, it doesn't work. In AS3 you can't attach scripts to objects anymore, so I am running into a lot of problems with that. How would I go about fixing this? Thank you in advance.

Aligning Variable Sized Objects And Objects Inside Them
Hi,

How do I align a movieclip, which width and height is user-defined, inside another object (this one is static, though). Top-left alignment is easy, x=0 and y=0, but what about center, center left, bottom left, etc? Math(.round) i suppose, but how?

and

I want an object (static) inside the movieclip (user-defined) to stay aligned to, for instance, the top right corner, similiar to the minimize, maximize and close buttons at the top right of your browser..

The height and width data is pre-defined by the user in another file... But that does probably not make any difference...



If anyone could help me with this, I'd appreciate it alot!

Thanks!,
Peter

Best Way To Hide On Stage Objects When Other Objects Need To Be Shown?
A typical nubee question..What is the best way to hide objects on sage when a button from navigation is clicked and in response other information or objects need to be shown instead of the one previously on stage?

How To Output Both AS Objects And Drawn Objects On Pages?
Using Flash 8;

Hello,

I am building a site entirely in actionscript and the "shell" of the site, the pages, text, static images, come up and work fine, no problems.

However, I'm having troubles trying to implement Kirupa's "XML_Flash Photo Gallery", for one of my pages, link here:

http://www.kirupa.com/developer/mx20...otogallery.htm.

I'm running into troubles because my pages are entirely actionscript and this tutorial uses objects which were drawn by the drawing tool.

I have been trying to get both actionscript and drawn objects to work together and cannot get it right!!

Questions:

1) In terms of layering or frames, What is the best way to output on your pages both "objects drawn by the Flash drawing tools" and "actionscript objects"?

Is this better handled using frames or layers? Should I place my actionscript on the first few frames, then my "drawn objects" on the later frames? Or use layers and have my AS code above or below the manually drawn objects?

For example:

I have my actionscript on layer 1. Then use drawing tools to draw a box on layer 2.

When published, I want the "manually drawn box" and "the actionscript drawn objects" to both be viewable on the pages. Do I place the "drawn" layer above or below the

actionscript layer? Or should this be handled by frames?

I have tried both and neither seem to work for me. When I do one or the other, it works, meaning, all drawn objects, obviously things are viewable, then if

I use all actionscript, things are viewable, but when I try to combine both, the manually drawn objects do not show up.

The actionscript objects show up correctly, but I cannot see the objects I have directly drawn on-stage.

In my actionscript, I use, "_root.getNextHighestLevel()", for each of the objects, this works fine for all the actionscript objects. However, I did nothing

for the objects drawn using the tools, should I attach the same "_root.getNextHighestLevel()" to those objects drawn on-stage?


Or,


2) Should I try to draw Kirupa's objects on my pages using actionscript?

Thanks, any help is great!!

Dave.

Help: Stage Objects Get In Front Of Script Objects?
This is getting me mad...

addChild(my_script_object);

I can't see it...

If I try trace(numChildren) I get 10, so then I try addChildAt(my_script_object,9) and still cant' see it.

If I delete all the objects in stage then I finally see it.... If I delete one by one I find my_script_objects gets beneath a bitmap placed by hand by the designer.

Any ideas?

TIA

Best Way To Hide On Stage Objects When Other Objects Need To Be Shown?
A typical nubee question..What is the best way to hide objects on sage when a button from navigation is clicked and in response other information or objects need to be shown instead of the one previously on stage?

About Referencing Objects And Copying Objects
This is for AS1

hi,

i should know this but i got lost for a bit, can someone make this clear:

i have the following:

code: myobject=new Object()
myobject.var="hello"
getvar=myobject.var

In this case, get var has a reference for myobject.var, or it has just copied de value? mean if i update myobject.var to "good bye" get vatr will be that, too, or will stay as "hello".

If it's just a reference, how can make it a different variable, i mean, assign the value of myobject.var to getvar and loose any relationship between myobject.var and getvar, so if i update one, the other doesn't.

Anyone?

Problem With Class Objects Within Objects
Hi There,
I am having trouble creating an oop grid.
My initial object is "world" shown below which will contain an array of "Row" objects, which in turn contains an array of tile objects.
As i build up the rows and assign the tiles everything seems fine but when i try to retrieve the values the tiles in each row returns the same values from each tile..


class world{

//declare class members
private var goalScore
private var mapPreview
private var title
private var editor
private var createdBy
private var movieBorder
private var instructions
private var rows = new Array()

//Constructor
public function world(Param_goalScore, Param_mapPreview, Param_title, Param_editor, Param_createdBy, Param_movieBorder, Param_instructions){
this.goalScore = Param_goalScore
this.mapPreview = Param_mapPreview
this.title = Param_title
this.editor= Param_editor
this.createdBy= Param_createdBy
this.movieBorder= Param_movieBorder
this.instructions= Param_instructions
}

//Methods
public function createRow(){
if (rows==null){
this.rows[0] = new row()
}else{
this.rows[rows.length] = new row()
}
return this.rows[rows.length-1]
}

}
class row{

//declare class members
public var tiles = new Array()


//Constructor
public function row(){

}

//Methods
function createTile(Param_tileType, Param_completionScore, Param_objectType){
if (tiles==null){
trace("created first tile")
this.tiles[0] = new tile(Param_tileType, Param_completionScore, Param_objectType)
}else{
trace("created tile " + tiles.length +" tiles="+tiles)
this.tiles[this.tiles.length] = new tile(Param_tileType, Param_completionScore, Param_objectType)
}
return this.tiles[this.tiles.length-1]
}

}

class tile{

// declare class members
public var tileType;
public var completionScore;
public var objectType;
public var character;


// Constructor
public function tile(Param_tileType, Param_completionScore, Param_objectType){

tileType = Param_tileType;
completionScore = Param_completionScore;
objectType = Param_objectType;

//movementPreset = Param_movementPreset

//error = Param_error
//errorImage = Param_errorImage

}

// Methods

}

Any advice will be greatly received.

Jason

Mask Objects And Masked Objects
Well.. I don't know if there is already a thread on this subject, but I have this doubt, and I would really like some support.

Been trying to use one mask object to mask several movies, but it doesn't seems to work. Has anyone ever managed to do this?

For example:

Let's say I have three MC - man, woman and baby are their names - and I want to use setMask to mask then so they walk behind the walls of a house, but just show up through the window. I create, then, a mask object - one object with the shape of the window inside it - named it windowMask, put it in _root and added to my actions layer the following lines:

Code:
man.setMask(_root.windowMask);
woman.setMask(_root.windowMask);
baby.setMask(_root.windowMask);
Unfortunately, only the last of them - baby in this case - is masked.

Can't I use one mask object to mask multiple MCs?

Everything works fine if I duplicate the mask MC and set each copy as a mask for each of them.

Code:
man.setMask(_root.windowMask);
woman.setMask(_root.windowMask1);
baby.setMask(_root.windowMask2);
The thing is, what I wrote above is just an example. The real movie has 30 to 40 MC which should be masked by the same mask object and I don't want to have 30 to 40 mask objects dangling around my movie...

Mask Objects And Masked Objects
Well.. I don't know if there is already a thread on this subject, but I have this doubt, and I would really like some support.

Been trying to use one mask object to mask several movies, but it doesn't seems to work. Has anyone ever managed to do this?

For example:

Let's say I have three MC - man, woman and baby are their names - and I want to use setMask to mask then so they walk behind the walls of a house, but just show up through the window. I create, then, a mask object - one object with the shape of the window inside it - named it windowMask, put it in _root and added to my actions layer the following lines:

Code:
man.setMask(_root.windowMask);
woman.setMask(_root.windowMask);
baby.setMask(_root.windowMask);
Unfortunately, only the last of them - baby in this case - is masked.

Can't I use one mask object to mask multiple MCs?

Everything works fine if I duplicate the mask MC and set each copy as a mask for each of them.

Code:
man.setMask(_root.windowMask);
woman.setMask(_root.windowMask1);
baby.setMask(_root.windowMask2);
The thing is, what I wrote above is just an example. The real movie has 30 to 40 MC which should be masked by the same mask object and I don't want to have 30 to 40 mask objects dangling around my movie...

Making Objects Go Behind And In Front Other Objects
Say I wanted to tween something so that it like rotates around it.
IE: a moon rotating around a planet, an electron orbiting a nucleus

How would I make the orbiting object go in front and behind the stationary object?

AS3: XObject Class - Treat Objects Like XML (E4X4O - "E4X For Objects")
I just finished this a few minutes ago (coincidentally while at a SilverLight camp ). Its an AS3 Object that allows you to add "elements" in the form of objects much like you would with XML using E4X. By assigning values to an XObject, you are adding that value into its "node" structure as one of its children with the given name. Retrieving a property, instead of returning a value, returns an instance of XObjectList which is essentially a list of objects (like XMLList) that are defined to that property. As with XML, there is a separation of elements and attributes using the @ character to precede references. Without @ you access a child, with, you are accessing a property or attribute of that particular XObject or whatever object defined inside it. Setting an attribute of an XObjectList, assigns the value to that property of all the objects in the list.

Its a little hard to explain. Its better to just see some examples.


ActionScript Code:
var rootNode:XObject = new XObject();rootNode.one = new Object();rootNode.two = new Array();rootNode.two = 20;rootNode.two[1].deep = "Hello XObject";rootNode.@three = "attribute";trace(rootNode);/* output:<XObject three="attribute">    <Object:one />    <Array:two />    <int:two>        20        <String:deep>            Hello XObject        </String:deep>    </int:two></XObject>*/



ActionScript Code:
var rootNode:XObject = new XObject();rootNode.a = 1;rootNode.a = 2;rootNode.a = 3;delete rootNode.a[1];trace(rootNode);/* output:<XObject>    <int:a>        1    </int:a>    <int:a>        3    </int:a></XObject>*/



ActionScript Code:
var myMcs:XObject = new XObject();myMcs.badGuys = enemy1_mc; // movie clips on the screen...myMcs.badGuys = enemy2_mc;myMcs.badGuys = enemy3_mc;myMcs.badGuys.@x = 100; // all enemy mc's move to x = 100  


It's pretty much done, but there might still be some problems, so if anyone finds any, just say so. I'm not sure how many more methods I might want to add in addition to what's there now (to match XML) though I think I want to keep it as simple as possible, so probably not much more, if any, than what's already there. To see what's there now, you'd just have to check out the classes - its not much.

When Is A Web Colour Not A Web Colour?
when it's in flash apparently.

what's going on with the colour shifting?
how do i get around it?

and why is it when i import an alpha channel (.png)
it actually has a really light background?

what can i do? this looks really lame now.

please help.

Colour Fx
How do you get colour effects like Fire and Sky on Flash?

Colour ?
Hello ,
How do you have a picture or a button that when you move the mouse over it ,it changes colour , like it goes brighter or darker or it fades away.

Colour
and now that we have buttons and scripts floating all over the place, where on earth would you start writing a script to change the colour/alpha of the second movie clip when you curser over the first ???
drive me round the twist this flash stuff : )

Colour Changes By Day
Hello all,

I'm new to the forum - thanks in advance for any help.

I have an idea, but so far that's all it is.

I'd like to have a flash animation, with my logo, a small animation and...

I'd like the background of the flash file to change depending on what day of the week it is.

E.G.

array
If today = Monday, background colour = blue;
" " = Tuesday, background colour = green....

and so on.

Any help is much appreicated.

After that, I'd like to do the same with Javascript, but thats for another section.

Dan

Copyright © 2005-08 www.BigResource.com, All rights reserved