Tuesday, November 5, 2024

Using Anchors to Bookmark and Navigate

With Flash MX you have the option to publish your movies with Named Anchors. This will add anchor tags to your HTML enabling your viewers to bookmark pages inside your flash movies as well as use their browser back and forward buttons.

An interesting problem with using the back arrow using this tutorial is that if
you click on the last button of the movie and hit your back arrow on your browser
you will be directed to the anchor previous to the last anchor, which would be
anchor 3 rather than back to the beginning of the movie.

To start the tutorial create a new layer and call it “Anchors” This is the layer that we are going to use to name each anchors on the time line. I inserted a blank key frame every 5 frames for this example.

Now click on the first frame in your timeline and name your frame lable in the properties menu. For this example I named my frames 1, 2, 3, 4. When you name your frame make sure to change the Label type. The back button will not work if you don’t assign the label type to Anchor. The Label type is located right below the Instance Name input in the Property Menu.

Repeat this step for each of our areas.

Now create another new frame and insert a blank key frame every 5 frames as we previously did for the “Anchor” layer. Also make sure to name your layer for easy organization.

Now in each of the separate areas insert either text or a picture letting you know which area you are viewing. I simply named each section 1, 2, 3, and 4. This layer is simply for testing purposes to ensure that we created the movie properly.

Adding buttons

So that you will be able to navigate each section you need to add buttons. Create another new layer and create 4 squares. Highlight a square and hit F8 to convert your graphic to a button. Repeat this process for all of your buttons.

Now we are going to add our actions to each button.

on ( press )
{
gotoandstop( “1” );
}

Make sure to change the frame to correspond with each of your sections.


Now to change our publish settings.

Go to File > Publish Settings or CTR+SHFT+F12

Under format make sure that Flash and HTML are selected.

Then click on the HTML tab. Under the Template option select Flash with Named Anchor.

Now it’s time to test our movie. If everything is done properly you should be able to jump back and forth between your sections using the back browser button and bookmark each section.

Let me know if you have any questions!

Having created the outlines for FlashNewz and FLADownloads, John has become a strong voice in the Flash Community. His reviews and tutorials give great insight and knowledge to readers around the world. He has a keen eye for what’s hot and what’s not in the Flash world. He has also developed and continues to run his own flash portal as a side project to keep his mind on the Flash community

Being a key designer for advertising creative, he’s got style when it comes to grabbing readers attention. With a proven track record, there isn’t much this guy can’t handle.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles