Skip to main content
Garry Bradley
Inspiring
April 27, 2009
Answered

Can anyone help with the scripting on this file?

  • April 27, 2009
  • 1 reply
  • 2774 views

Hi, I hope someone with a bigger brain can help me out here.

I've got an existing Flash CS3 file that makes up the result at http://www.infusion-set.com/flash/Elearning/Inset30/inset30_eguide.html.

The client has asked if I could add an extra tab at the top after 'Reconnecting' called 'Contact Us' with link to an extra page. All the design has been done in ActionScript 2 with references to XML files for the dynamic content because it's been done in other languages as well.

I've amended the existing XML file with the correct references for a new page and an accompanying .swf file to play in the animation area.

I've attempted a .fla version where I duplicated one of the existing tabs script, changed the XML references and changed the variables where necessary to 'con or 'Con' (representing Contact Us). Unfortunately it made the tab menu go completely off the page and was obviously wrong in some way.

Can anyone give me a clue as to what to change here on the original file as I'm a bit of a novice with ActionScripts, hence me asking.

For reference I've attached HTML files with the original file scripts and my incorrect version. The  timeline is 103 frames with the scripts placed at frame 1 and 102

Thanks.

Garry

This topic has been closed for replies.
Correct answer Ned Murphy

The thing is Ned, there are no button instances in the Library, it's all done in ActionScript which doesn't make it too easy to place anything visually.

By the way the file links are now in CS3 so if you need to take a look you'll see what I mean.


The buttons are all created using the same library object (but MC), except for the code you have in the revised file does not call on that for the con button.

You have it calling on something with a linkage name of "con", which a quick check tells me doesn't exist--so it is undefined in the code when you try to use it.  I found this by using trace(newConBut._x); after its _x value was assigned, as I mentioned you should try.   So the first thing you want to do is change the following line from...

var newConBut = _root.attachMovie("con", "conbut", _root.getNextHighestDepth());

To

var newConBut = _root.attachMovie("but", "conbut", _root.getNextHighestDepth());

so that it uses the but MC that serves that purpose in the library.  Then you want to correct the _x assignment of the buttons to what I think you had earlier...

newConBut._x = 650-newConBut._width;
newRecBut._x = newConBut._x-newRecBut._width;

Here is a picture of what those changes do (note, without the XML file I had to finagle things just to work, so the biutton labels aren't what they will be)...

menu.gif

1 reply

Ned Murphy
Legend
April 27, 2009

It would be more helpful if you could indicate what you have changed/added to the file.

Garry Bradley
Inspiring
April 27, 2009

Hi Ned, thanks for the prompt reply.

I'm attaching the files with the script I've changed in red.

Wrong I'm sure or they'd work.

Ned Murphy
Legend
April 27, 2009

It might be my eyes playing tricks whilst trying to juggle the different files, but it looks like the files are all the same revised versions, meaning what you label as being the original code is not.  In any case, you say the problem is the placement of the buttons, indicating they display off screen.  Do you know that or is it that you cannot see them and assume they are off screen?  Could you also indicate the relationship between frame 1 and 102... Is the scene animated such that the file starts at 1 and stops at 102 when the file opens, or are they arrived at for different purposes?  Could you make the fla available for download?