Friday 8 October 2010

Coding Films into Flash

The development work I have covered during lesson:
During this lesson I coded my films into flash. To do this I opened a pre-coded document that had the majority of the code that i needed to make my films load in my front end. I opened the pre-coded document and I then copied sections of the code into my front end. The sections that I copied were the declaration and the function and event code. After I copied the code into my front end I had to check the names of my SWF film files, I then copied the name of the files into the brackets in the code and changed some areas of the declaration so that it would work with my buttons and forms. I then tested my front end to see if the videos loaded when each individual button was clicked.
This is the code that i had to enter into my Flash porject so that when the button was clicked the file files would load. The code below is asking the program to run a process, when btnscene1 is clicked on Screen2, it is asking the program to open the scene 1 swf file. The next piece of code is asking the program to locate and open the video file what is wanting to be loaded, this is displayed in the brackets and speech marks, the file itself has to be located in the same place as where the flash project is saved.
frmScreen2.btnscene1.addEventListener(MouseEvent.CLICK, openscene1);
function openscene1(evt:Event)
{ //channel.stop();
var urlReq:URLRequest = new URLRequest("scene1.swf");
var myLoader:Loader = new Loader();
myLoader.x = 120 ; myLoader.y= 60 ; myLoader.load(urlReq);
// passed to the ldr
try { removeChildAt(4); } //One bigger than the number of forms, starts from 0 catch (e:Error) { }
addChild(myLoader); // display object container}
How this fitted in with the client brief:
This fitted in with the client brief because the client breif stated that my front end must have at least 4 scenes included. By importing the idividual files into the Flash project i was able to meet this requirement.
Skill Number:
18

No comments:

Post a Comment