#1 (permalink)  
Old 08-09-2008, 08:09 PM
Junior Member
 
Join Date: Aug 2008
Posts: 2
Default Tips to changing this file.

Below are some tips I discovered while working on this file.

First, always make a copy of all the files in the Source folder and the Test folder before you mess everything up....



How to Add a tag to the XML and the Flash Movie.

In my example we are going to add a field called author so lets, add the text field in your flash movie first. Double-Click the "content1" item on the main stage that holds all the text and other items. Double-Click the main item within the clip called "scroll_text". Click the title text box above the big text area and right-click and copy. Right-click elsewhere and select paste. Position the new text box where you want it and change the instance name in the properties window from title to author.

Now, let's open up our xml file located in the test folder. For each item, add a new set of tags i.e. <author>George Washington</author>. Make sure it's located within each <item></item> tags and make sure it's spelled exactly the same as our new text box we added earlier. Add this new tag for each item and save this file.

Now open up News.as. We need to tell the script to read in our new field within the XMLRead function. Scroll down to around line 75. You should see several lines that begin with "mainNode.nodeName.toLowerCase()....." add the below line within that block:

mainNode.nodeName.toLowerCase()=="author"?news_obj ect.author=mainNode.firstChild.toString():false;

Now we need to tell the script to actually place the the new field in our movie in the addContent function. Scroll down to around line 434 and find the comment line "//set new title". Add the code below after that line:


//set new author
mainMovie.scroll_text.author.text=instance.news[index].author;


That's it. Save News.as and go back to our Flash movie. Save and Publish. Upload your new .html, .swf, and .xml file and preview your good works.





How to Reposition the Picture.

Same as always, make sure you have a good working copy of everything.

Open up News.as in the test folder. We need to add a couple lines of code in two different places here. Scroll down below the addContent() function around line 464 or so and find the line that says newMC.attachBitmap(bitmapPic, newMC.getNextHighestDepth());. Add the code below right after that line:

Code:
newMC._x=40; //move picture to the right x number of pixels
newMC._y=10; //move picture downward y number of pixels

Scroll down a little further from there around line 512 find the line that begins with var newMCI = instance.free_content.createEmptyMovieClip .... Add the same code as above right after this line.

That's it. Save News.as and go back to our Flash movie. Save and Publish. Upload your new html and swf file and preview your good works.



How to Remove the Reflection below the Pictures.

Same as always, make sure you have a good working copy of everything.

Open up News.as in the test folder. We need to add a couple lines of code in two different places here. Scroll down below the addContent() function around line 466 and find the line that says //copy the mirrored movie clip. Comment out the next several lines by placing "//" in front fo the lines.

Code:
//copy the mirrored movie clip
//bitmapPic.draw(_root.container["inverted"+index+"N"]); newMCI._y+=5+newMC._height;
//newMCI.attachBitmap(bitmapPic, newMCI.getNextHighestDepth());
//newMCI._yscale=-100;
//newMCI._y+=newMCI._height;
//prepare and set the mask
//instance.used_content.mask._x=newMCI._x;
//instance.used_content.mask._y=newMCI._y-newMCI._height;
//instance.used_content.mask._width=newMCI._width;
//instance.used_content.mask.cacheAsBitmap=true;
//newMCI.cacheAsBitmap=true;
//newMCI.setMask(instance.used_content.mask);
If you'd like to also remove the border around the picture comment the next two lines too.

Now scroll down a little further and find the same block of code around line 519. Repeat the same steps as above by commenting out those lines.

That's it. Save News.as and go back to our Flash movie. Save and Publish. Upload your new html and swf file and preview your good works.



How to Resize the Flash Movie.

Same as always, make sure you have a good working copy of everything.

This one is much more tricky. It's not hard at all, you just have to pay great attention to details. There's no secret at all. You just have to resize what you want, how you want it BUT keep everything in line and proportional. There are several items placed over other items for masking purposes. The main container on the stage is a duplicate of the content container. An additional duplicate container sits off to the left. Changes made to the main container will auto change in the one to the left. Resizing the main container will NOT resize the duplicate. Make sure you resize both the same and keep them aligned. It's really trial and error. If you are unsure about something dont delete it, just move it off the stage so it isn't seen and see what effect it has.



You can see examples of all these changes in a movie I created here: My Example News Ticker


I hope this helps somebody.

- GSMACK

Last edited by GSMACK; 08-09-2008 at 09:23 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.