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




Linking Order Of Objects To Animation



hi, im pretty new to flash, hope someone can help.

i need to create an application that allows kids to drag graphical blocks, representing directions, to an area on the stage, and if the blocks are placed in the correct order, an animated car will take the correct route around a course; the blocks are more or less representing elements of a program, and if its placed correctly, the animation will be carried out, else error messages will be displayed. can this be done in flash 8, which is the version i have, and would there be much work involved?



ActionScript.org Forums > Flash General Questions > Flash 8 General Questions
Posted on: 01-16-2008, 07:30 PM


View Complete Forum Thread with Replies

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

Z ORDER OF OBJECTS
Hi,

I am creating a portfolio where all of my images are being loaded from an xml doc. The thumbail loader is being loaded into level0, my problem is that all of the images are being loaded over my UI assets that are already on stage. Flash is not respecting the Z order of my layers and my conflict is created because both my main timeline and my dynamic movieclip holders are both on level0. How can I move the thumbnails below my UI assets. You can see my problem if you go to http://www.techntoon.com/portfolio7.swf and click on any thumbnail you will see the large image appears over my nav bar.

Thanks.

Accessing The Tab Order Of Objects
Hello,
I am having difficulty determining the identity of the next object in the tabbing order. I set the tabIndex of a group of text fields as they are attached and upon running the app the tab key works as expected. However, another requirement is that upon a condition (say length of field reached while typing) I want to actionscript to move the focus to the next text field in the tabbing order. The problem is I don't know what field that is.

getFocus() will return me a tabIndex of the field I am on. But setFocus() wants an object name. focusManager has a nextTabIndex property but there again, just a number. I could build my own array of objects as I set the tabIndex, but that seems a little clunky and operates independently of Flashes handling of it.

I understand this functionality was meant for use with the tab key, but it sure would be nice to query against wherever Flash has stored its reference to objects in tab order. Is that possible? Or is there another way to approach moving the focus the next field without requiring a tab keystroke?

Thanks for any help you may provide.

Changing The Order Of Movie Objects
i'm trying to switch a movie from the backfround to the foreground position so that it is in the top most position for special condition. Is there any way to do that with script so that it is changed in runtime?

thanks,
joebe

Help Linking Hit Detection To Animation In A Game (death Animation)
Hi everyone - I've just been experimenting with creating games in flash MX 04 and I've come across a problem that's had me stuck for a few hours now. I have just about everything working in my practice game, except when my character gets hit with the projectile... it won't go to the death movieClip that's located in the character's main movie clip (on frame 6 of it).

If anyone could check out the project file and let me know what i'm doing wrong it'd be greatly appreciated. The controls for the game are just the arrow keys to move the character, and down ducks - avoiding the projectile.

Thanks

Checking The Locations Of Multiple Objects And Their Order
Hi, this is my first post and I hope you guys can help me out.

I have a pretty decent understanding of Actionscript so I don't think I should have too much trouble understanding your help.

Well, the idea for a thing I'm doing is that I have several objects that can be dragged and dropped along the bottom of the screen.

I have 8 placeholders across the screen also and I want the user to drag the 8 objects into these places and then the script will check to see if they are in the right order, left to right, and which object is in which postition.

I have 8 Movie Clips as the placeholders and my script will use their x and y values +&- around 50 (so I can change the positions easily If I need to) to determine if the dragged object is within a certain area around it and then it tweens the object to the center of the placeholder in effect locking it in place. I have that down fine.

What I would like to know is what the best way to determine which object is in each placeholder so I can check if the user made the correct answer and display on a results page which order the user places them in vs the correct response.

I have ideas of how to do it but they involve alot more script than what I think I need, I'm pretty sure there has to be an efficient way of doing this, perhaps using arrays in some way.

Thanks in advance.

PS: Is their a way to have looping music continue across scenes? I know you'll probably say don't use scenes but If it can be done with scenes I'd prefer to do it that way.

Deleting A Line And Swapping The Order Of Objects
Hi,

I'm making an interface where a line is drawn between two buttons when they are pressed consecutively.

I have 2 unwanted effects:

1. I want the lines to appear behind the buttons, not be drawnr the buttons.

2. In the next scene, I want to be able to move one button to another point, and the line to still be attached to that button. (I dont want to drag it iosition, i want to enter coordinates into a text input and the button moves there instantly)

If somebody could answer these questions i would be very grateful.

Adam

[MX04] Simple Code, But In Which Order Are Objects Created ?
Hi,

I have a really simple example but as simple as it is, it does not work (I am using MX 2004).

I create a movie clip in the library. It has got two layers:
1. a small black square, initially 10x10
2. an action layer with the following code:

Code:
stop();

function setHeight(h:Number)
{
trace("setHeight");
this._height = h;
}

function setWidth(w:Number)
{
trace("setWidth");
this._width = w;
}
I dragged the movie clip on the stage and named it blackSquareMC.
The following code works fine:

Code:
_level0.blackSquareMC._width = 100;
while this does not have any effect:

Code:
_level0.blackSquareMC.setWidth(100);
It seems the function is never called. I suspect it is due to how objects are created in Flash.

Could anyone help me with the basis, please ?
Many thanks,
Kz.

How To Change Order Of Layers During Animation
Newbie here - idiot instructions PLEASE!

I am working on my first flash document and I have two layers - each layer containing a text object. I have one of text object of layer1 dropping down and bouncing back up above the text object of layer2. On the way down, I want the text object of layer1 behind layer2 but on the way back up, I want it in front of layer2. How do I change the arrangment (order) of layers midway during animation. (FYI - the animation is done with motion tweens).

Thanks

Is This Possible? (linking Between Objects)
I have a flash application. It has a dynamic text field. When I run the application an swf movie loads into flash. The swf movie has a button on it. Is it possible to make the button (on release) load some text into the dynamic text field? what do I write inside the button's AS window?

Linking To External Objects
Hi folks, I was hoping to get help with a problem I'm having at the moment.

Basically I need to find the code that will allow you to click on a button within my flash movie and it then opens a director projector file. The director file isnt inside the movie timeline at all, I just need to get the button to start the director file playing.

Would anyone know how this is done?

Linking Classes And Stage Objects
I wrote a video player for my last project which was no problem, although I ended up just assembling the assets (buttons, timeline, playhead, etc) on the stage then then putting the player code on the timeline with my other code. This is admittedly not the best way to build this. So I want to go back and write a class for the video player.

Question is, if I'm going to build a generalized class for a video player, how to I connect it to the items I want the interface to be on the stage? Ie, the buttons, playhead, etc? What's the correct way/best practice way to do this?

Linking Both Ends Of A Single Straight Line To 2 Different Objects
I was wondering, and I 've seen it around, how do you in Action Script link two ends of a straight line to 2 different objects, so that when you move one of the objects, the line is always connected. I don't really need alot as far as answeres go, but can someone point me in the right direction?


Thanks again

Problem Linking My Button Objects In My Flash Menu...
Hello all, I recently got back into flash after a 6 year hiatus.

I have CS3 and I have been trying endlessly to create a simple flash menu that has text links with a rollover effect.

I created a project and set up separate buttons with rollover effects, but if i try to put a URL link for any of the buttons in the button editing area it is always somewhat faulty... meaning when I publish and test it i have to literally click on the link 15-20 times with my mouse until it shoots me to the link.. its very odd.

I am guessing I am doing something completely wrong.

I uploaded the file in a zip. This file has my buttons WITHOUT any URLs input to see if anyone could add the proper code for one of them and I could apply it to the rest... or just tell me I am way off.

http://www.allergik.com/menutest.zip

Thanks.
Paul

Linking Data To My Animation
Flash 6 MX

Attached is Archive.zip which contains the flash file and text file (variable).

I'm sure I've almost got it. I'm trying to animate this arrow up and down using data from a text file. The data file seems to be loading into my text box okay, but the arrow doesn't move. If I enter the value maually it works.

Thank you in advance for any help you can provide.

--Steve

Shared Objects With Animation
I have read all the forums and tutorials on the net, but I cannot find a solution to my Shared Objects problem.

I have an animation in the main timeline, from frame 1 to 15.

I only want to let the user see the animation once. The second time he views it it should gotoAndStop at frame 15.

Now I figure Shared Objects would work but I'm having difficulty.

Heres my code:

Frame1:
user = SharedObject.getLocal("user_profile");

if (user.data.name == undefined){
_root.gotoAndPlay(2);
} else {
firstname = user.data.firstname;
gotoAndStop(15);
}


Frame 15:
stop ();
user.data.firstname = firstname;

Thanks guys.

Share Animation Between More Objects
Is it possible to share the same animation in a library object in order to use it with different text content?

In other words, is it possible to have more text that use the same animation, so I don't have to change all of them?

Is maybe this only possible in actioscript?

Linking A Simple Animation To Html
I have a simple animation on my site that i want to link to a forum entry page. The adress i want to link to is a simple html page address. I am using MX 2004 and for the life of me i cannot work out where to set the link address/URL.

Could someone please let me know. It is probably staring me in the face, but it has had me stuffed for about 6 hours now!

Thanks heaps

Linking Animation To Button But With Easing
Hello All

I have a little project that I'm working on where I have a navigation system which is controlled by a scroller. So what happens is that if you move it up some elements get larger and if you click on the down arrow those ones get smaller and others get larger... pretty simple stuff and nothing I can't do myself.... what I'd like to do though is have easing so that if you move up elements get larger with easing... therefore starting slower and going faster then slowing down at it gets to it's target...

Any idea how to do this?

Animation / Objects With Consistent Distance
Hi !

Months ago I saw a tutorial for a animation with two draggable objects, that always moved back to the same distance after dragging ... but I forgot where I saw it. Do anybody remember this or similar kinds of animations ? And know where to find it ?

Thanks,
Bastian

Linking Another Swf File To You Current Flash Animation..~~
Hey!

I am designing my website at the moment n developing it in flash 8. m not much of an actionscript person, unfortunatly hence i need your help here... !!

now i have created a link FLASH in my portfolio, and i have put some thumbnail images of the flash animations i have done. I have made them all buttons. Now what i wanna do is.. when i click on a particular button i want it to open that flash animation in another window...! but i dunno what script shud i write.... please help me do this..!! I have put all the swf files that have to be linked to their respective buttons in the same folder as my fla file..! but whats the code to link them and clicking and opening them in another window...i dont know.

Thanks For your help.

Cheers!
R

Linking Html Pages With A Flash Animation
Hello !

1st post here, thank you in advance for your help and I hope you are all well etc etc

Basicly I am designing a standard HTML site with a flash navigation system. some of the HTML pages also have a flash .flv video player embeded in them.

what I would like to do is link the html pages in such a manner that when you click on a menu button (the flash navigation system) the bottom border line moves up to the menu (so you the screen is white and you cant see anything) then returns down to its orginal place with the new page (sort of like a curtain up curtain down effect)

is this possible to link my exsiting html pages like this or do I have to recreate the whole site as a flash site? + how would I go about achieving this effect

if you could give your answers in as much detail as you can be bothered it would be much apprecieated as I am only a beginner

Thank you in advance

PS how do I go about changing my username as I have just realised I have splelt 'Falloutsoldier' wrong - doh!!!

Number Of Vector Objects In A Flash Animation
hI,
I am developing a flash game which has about 10 objects animating on the screen along with the bitmap background. The objects are heavily shaded and obviously result in a performance slowdown. Now if i replace those shaded vectors with the just one gradient object then what would be the effect on the performance? Does replacing the bitmap backgounds(they are also animating) with vector ones make a difference.
Right now the animation doesnt run smoothly even on a PIII 256 MB RAM. what possilbe optimization techniques i can use to get rid of this problem?

During the tests the animation was done without any scripting.

Manuj

How Do I Apply An Animation Effect To Multiple Objects?
Hello,

Could someone point me in the right direction. This is my first flash game attempt. I'm using Diamond Mine as a model, and I'm stuck here:

What's the technique for applying effects to random objects on the board...

I'd like to deal the images of playing cards out. On mouseover I want a mild light aura to circle the card.

How do I apply this effect to each card without making an effect for each card in what will eventually be a 52 card deck?

Another example: I have three of the same suit. When this condition is true, the cards, whatever they happen to be, will fall, spin or whatever. Are these the same technique?

What's the technique for applying effects to random objects (Ace, king queen) but of the same object class (cards) Should I use an array for the deck?

I haven't found any tutorials addressing this, or I'm not understanding them. Thanks for your time.

- kallist0

Time Based Animation - Creating New Objects
I'm trying to create animation of balls. Every time the ball touches right edge of the board it should divide into two smaller balls and all the new balls should behave in the same way until quantity of balls reaches specified value. Unfortunately only the first ball is being animated. I believe there is some problem with 'offset' because I got '0' when I'm tracing 'offset' var every time new ball is created.


Code:
package newpackage
{
import flash.display.Sprite;
import flash.events.Event;
import flash.utils.getTimer;

public class Main extends Sprite
{
public var ball:Ball;
public var board:Board;
public var ballsArray:Array = new Array;
public var time:int;
public var changeX:int = 1;
public var changeY:int = 1;
public var offset:Number;
public var offsetY:Number;

public function Main():void
{
time = getTimer();

stage.frameRate = 60;

board = new Board();
board.x = 50;
board.y = 50;
addChild( board );

createBall(100);
addEventListener( Event.ENTER_FRAME, onEnterFrame );
}

public function createBall( rad:int = 20, posX:int = 50, posY:int = 50 ):void
{
ball = new Ball( rad );
ballsArray.push( ball );
ball.x = posX;
ball.y = posY;
ball.speedX = - ball.range( 20, 5 );
ball.speedY = - ball.range( 20, 5 );
board.addChild( ball );
}

public function onEnterFrame( event:Event ):void
{
for ( var i:int = 0; i < ballsArray.length; ++i )
{
var ball:Ball = ballsArray[ i ];
moveBalls( ball );
}
}

public function moveBalls( ball:Ball ):void
{
ball.radius = ball.width / 2;

var elapsed:Number = getTimer() - time;
time = getTimer();

offset = elapsed / 1000;

ball.newPosX = ball.x + ball.speedX * offset;
ball.newPosY = ball.y + ball.speedY * offset;

if ( ball.newPosX + ball.radius > board.width )
{
ball.speedX *= - 1;
ball.newPosX = board.width - ball.radius;
if ( ( ballsArray.length < ball.BALLS_LIMIT ) && ( Math.random() < ball.PROBABILITY ) )
{
ball.width /= 2;
ball.height /= 2;
createBall( ball.radius / 2, ball.newPosX, ball.y );
}
}
else if ( ball.newPosX - ball.radius < 0 )
{
ball.speedX *= - 1;
ball.newPosX = ball.radius;
}

if ( ball.newPosY + ball.radius > board.height )
{
ball.speedY *= - 1;
ball.newPosY = board.height - ball.radius;
}
else if ( ball.newPosY - ball.radius < 0 )
{
ball.speedY *= - 1;
ball.newPosY = ball.radius;
}

ball.x = ball.newPosX;
ball.y = ball.newPosY;
}
}
}

Bug: Multiple Flash Objects On A Page, Animation Fails
I'm using flash 9, with actionscript 3.0. I have two flash objects on a page and randomly the animations of one or both of the flash objects fails. Has anybody else had this problem? Also, I think it might only be in firefox, as I cannot reproduce the issue in IE7

Importing Photoshop Images/Objects Into Flash For Animation
Importing Photoshop Images/Objects into flash for animation

I have created a nice website in Photoshop. I took a whiskey bottle and added a drop shadow and outer flow to it for mouse overs.

The issue is that I want to use JUST the images/objects withi Flash in pieces (not as a whole) so that I can animate each one individually.

I tried this method in Photoshop:

I ran the SCRIPT: Export Layers To Files
I then created a layer based splice with only the object highlighted
Then I Export as Gif, with only selected splice.

When I import to Flash it is bringing in a WHITE background. Even tho I set the gif to Transparent.

Anyone have experience with this?

See attached file to get an idea of the objects/images I created.

Importing Photoshop Images/Objects Into Flash For Animation
Importing Photoshop Images/Objects into flash for animation

I have created a nice website in Photoshop. I took a whiskey bottle and added a drop shadow and outer flow to it for mouse overs.

The issue is that I want to use JUST the images/objects withi Flash in pieces (not as a whole) so that I can animate each one individually.

I tried this method in Photoshop:

I ran the SCRIPT: Export Layers To Files
I then created a layer based splice with only the object highlighted
Then I Export as Gif, with only selected splice.

When I import to Flash it is bringing in a WHITE background. Even tho I set the gif to Transparent.

Anyone have experience with this?

See attached file to get an idea of the objects/images I created.

Possible To 'expand' Flash Animation To Move Other Objects On DHTML Page?
I have a weird question. I am an intermediate flash user, and I need to create a small filmstrip-like menu. Once a user selects an item on the menu, I need a "banner" to drop down from the menu. My questions are then:

1. Is it possible to "expand" the borders of a flash animation in such a way?
2. Will it be possible to have the drop-down menu displace the content below it on a dhtml site? i.e. a 100-pixel high banner drops from the original flash piece, is it possible to have the rest of the page move down 100 pixels as well?

I'm sure this is posted in the wrong place but this is my first ever flash-related post anywhere so please have mercy =)

Any help would be immensely appreciated! THANKS!

Order Form - Order Fields?
hi,

i just donīt get how to make the input fields become in a secuencial order when you press the tab button,
i mean give them the order i want,

and also, if you use the sendmail.asp in the server,
there also are very disorganisated,
with no specific order,

do any of you solve this deal ????

ok thanks

Drawing Order / Z-order
I've noticed that AS provides some functionality for setting the render ordering of sprites/objects onscreen, but it doesn't seem a very easy system. It kind of looks like you haveto know the index of every item to be able to do anything?

2 Examples I need to control this:

1)I load a pre-created SWF representing a game level. There is a background image and then a few things in front of the background. Now I dynamically ad sprites to the level. The sprites should always be shown in front of the background, but behind the other pieces of scenery.

2)I have many sprites on screen moving around. I want the drawing order to be that sprites lower down the screen are "nearer" than those higher up, so the drawing order should be to draw sprites in order of decreasing y-coordinates. Obviously sprites are moving around so the ordering needs to change often.

Can anyone tell me the kind of thing I need to do to make these situations work? There doesn't seem to be an easy way to just say "put this item behind that one", unless I plain misunderstood the docs?

Thankyou

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?

Load Order, Force Load Order
I was wondering if there is a way to force the load order of graphics, movie clips, buttons. I am most interested in force a paticular graphic in my swf file to load before everything else.

Thanks

Linking Movies V.s. Linking Levels (swf's)
I was reading about the different types of sites that can be created with Flash. Two of those struck me as very interesting- linking movies (which is supposed to be useful for actionscripters) and linking levels, or swf's. I was wondering what are the pros and cons of both of these methods, since I haven't decided which one I will use for the development of my future site. Thanks in advance.

Image Linking - Text Linking
Hi everyone

I need some help in what probably is simple a function.

I want to be able to make someone else change texts and picture on a flash-based homepage.

1) I want them to be able to upload a .txt-file and then it should change the text in a specific textbox.

2) the same thing with images

How do I do this?

i've been trying to use an empty movieclip and then I guess he sript should be something like:

empty_movieclip.load ??? ("text.txt", 1);
}

and

empty_movieclip.load ??? ("image.jpg", 1);
}


can someone clearify this?

I can't make it work...

best regards,
Skaatar

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.

Need Urgent Help How To Combine Transition Class Tween Animation And Keyframe Animation?
Hi! I have a transitional tween class animation assigned to "mc_logo" on frame 1. However on frame 100, I have "mc_logo" animated on the timeline by regular keyframe animation.
I have assigned the tween class animation to "mc_logo" on frame 1 and the regular timeline animation starting on frame 100 does not execute now when I test the movie...why?

Do I need to end/clear the tween class animation so the regular timeline animation will work again?

Here is the code on frame 1 so far:

import mx.transitions.*;
import mx.transitions.easing.*;
import flash.filters.*;
var LogoTweenY:Tween = new Tween(mc_logo, "_y", Bounce.easeOut, -120, 171, 30, false);

Thank you in advance for your help.
Attila

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