If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Flash Oddity

I really hope that Valhallen reads this, but Im sure theres other flash specialists out there too .....

Just to save anyone time: if you don't program in flash or aren't interested in it you may as well move on to a more interesting thread for you ....

Im building a website in flash and Im doing it so all images are loaded directly from their file folders as they're needed rather than enlarging the file size of the site by importing images and texts directly into the flash document.

What I'v done is created a Movie Clip Loader, Listener and Load Variables on frame 1 of an actions layer in a master document. Like this:

In a seperate Flash Document, created to hold a slide show, I have made a Movie Clip box to display the loaded images, 2 dynamic text fields, and 2 buttons ( previous and next)
And again on frame 1 of an actions layer of this same document there is the following code:

I haven't coded for the previous button yet, but we can imagine it'll look very similar to the above code for the next button ....
And to check this we would simply run the master.swf file. Everything here works well except for one minor (or not so minor) oddity that doesn't seem to be in any reference or troubleshooting manual.

When one views the slideShw.swf file they simply see the Movie Clip that is meant to load the images (blank, as it should be) and some static text, and everything is where it should be.
But when we go to the master.swf doc. and run it, we see the images (as we should) but the Movie Clip box that loads these is horribly mis-placed far low and far to the right (so the buttons are actually overlapping about midway through the images).

The master and slideShw documents are exactly the same size and its not in the alignment of anything I may have done (or not done), I think Iv narrowed it down to this line of code:

Its a basically simple line, using simple concatation and relative URL's.
I blame this line of code because if I comment it out, everything is aligned/placed correctly once again - I just, obviously, don't get my images loaded.
I can't figure it out, and Iv never seen anything like it before, it just seems so f***ing simplistically silly its maddening.

Before anyone replies to this I should say a few things about the nature of the site - its a commercial site, which is why Im being so cautious and meticulous about file sizes and simplicity & efficiency regarding future editing of the information, ALL images and texts are loaded, as they are needed from external files, based on external .css's.
And yes, I could rearrange the placement of things on the slideshw.fla document so everthing is properly aligned and placed when the master.swf is run, but then both the .fla and .swf of the slideshw.* are all messy looking and there lacks a professional looking layout on the backups, everything should be able to run properly as is, Im missing something and its something, I'm sure, very minuscule.

Any help is greatly appreciated, and I certainly hope Valhallens see's this (He's the one that got me interested in Flash initially).

I'll pre-thank all respondents now.

"In most gardens they make the beds too soft - so that the flowers are always asleep" - Tiger Lily

heh thanks for the ego boost - tho am not sure it is deserved
I actually aint had time to play around in Flash for ages - one of the down-sides to working as a php/mySQL developer, not alot of need for me to be doing much flash work these days.

First thing that springs to mind when reading about the alignment is the Flash bitmap big if memory serves me right this causes a slight shift down & right for any images loaded into flash. Tho am not sure if it would account for the complete misalignment you are seeing it may be a contirbuting factor. Its easy enough fixed you just allow for it in your alignment to start with.

Next thing is the way in which .swf / .jpg etc are loaded into a flash document. Their registration point (AFAIK) is set at 0,0 (top left) so say your moviclip is 200,200 and you set its registration point at 100,100 (middle) and then load another swf or pic into it the top left corner of the loaded file will start at 100,100. To fix simply move your loader movieclips registration point to 0,0 (or wherever you want the loaded files top left corner to start.

Also I didn't have time to go through your code in depth (hehe you've developed a completly different style to me - which is cool!) but are you checking that each instance is being loaded into a unique depth? [ Seems to have some good info on it ] I've seen some funky things happen when the depths are not arranged properly - tho nothing like what your describing.

To be honest unless you're actually using the code to allign the objects

Code:

this._x = 100;
this._y = 100;

or such like i dont see it being a code issue - more likly something in the organisation of the elements (movieclips) in the fla. If you are still having issues however why not load each instance into a movieclip off-stage and then align it using code at runtime. Just work out the pixel postions for the seperate elements and move them witin an onLoad on the target movieclip. Not the prettiest way of doing it (and takes away somewhat from the AS 2 style coding. But it should give you a good idea if it is a code issues or a problem with your mc alignment.

Ahhhh, Val, I knew I could count on ya' mate ............ even before I went to fiddle with it for the day, I was going to reply saying that I think you may have had something with the registration points - just made sense: I hadn't checked it out, it was very plausible and it was something simple. I decided to respond after checking it out since I would have responded again anyways, lol.

The reason I thought it may have something to do with that line of code is because, it wasn't misaligning anything until after I assigned an instance name to the Movie Clip. Never even thought about the registration points.

Out of curiosity, though Val, is there a way to re-assign registration points, without re-creating the whole symbol (Movie Clip, Button, Graphic etc.)?

I was kinda of hurried, so I just jotted down its size and coordinates, deleted it from the library (needed the same instance name so I didn't have to change the coding) and re-created it with a new registration point. Seems there should be a more efficient way of doing this - though it wouldn't surprise me in the least if there wasn't.

Thanks again, mate, I hope your enjoying the new direction you've taken in PHP/SQL.

Val ......... you remember at the beginning of the year you sent me to the link to the site of some of your flash projects?? I was wondering if you could re-post that link for me, for study purposes.

Thanks again, mate

P.S. Just because Im a curious f***er, you said that the way Im doing it is a different style than yours .......... maybe you wouldn't mind posting a bit of how you would have handled the same project, again ... for informational purposes - Im always looking to learn a new angle!!

"In most gardens they make the beds too soft - so that the flowers are always asleep" - Tiger Lily

Am afraid that site has gone to the great recycle bin in the sky - well not quite i still have a copy of it on my local machine its just no longer online (was done for a UK webdesign competetion - which i took first place in! ) but i can zip up the flash files - might even have some of the fla's to somewhere - and send them across to ya if you want?

as for the code - its just a different style. Esp with your naming conventions. I always postfix elements with element type in a different way

eg : myMovieclip_mc, myButton_btn and so on

and I have a habit of always capitalising the second word but not first - i dunno if you way works the same but using that format when typing in the actionscript pane (expert mode) flash knows that myMovieclip_mc is a Movieclip because of the postfix and displays a popup box with acceptable uses. May do the same for you as you still end yours MC, BTN just never tried that way