Ok here is my question. I had a school project where we had to build a website in Flash. So I built this site at purplefrogit.com (I bought the domain name cause I have asperations of some day starting my own business) That whole site is all contained in on Flash file using labels on the timeling to reference the different pages. I had a question I posed to my teacher that she just doesn't seem to understand. So here I am. On the support page which is a free blog that came from the hosting company, I wanted to have the links on the left hand side point to the coorisponding pages on the main site. So when you click the projects link it takes you to the projects page. How do you reference a label in a url? She keeps talking about the scripting in the Flash page and not getting at all what I want. I know how to reference the label in the Flash document. But this would be a major draw back of Flash if you can't reference individual pages that are created under one document. Kind of defeats the purpose of having it all in one documnet. Can this be done. and how? I don't need it for the class, but for my own personal quest to learn.

Dani AI

Generated

This is a deep‑linking problem: the browser URL and a label inside a single SWF are separate run‑time environments, so a bridge is needed between them. described the single‑file approach; pointed out that ActionScript can move the playhead, but that alone does not give bookmarkable URLs or back/forward behavior. Browser ↔ SWF communication is required.

Two practical approaches that were commonly used:

  • Pass an initial page token into the SWF when it is embedded (flashvars) so a link like support.html?page=projects loads the SWF already at that section. Example embed snippet:
<object ...>
  <param name="movie" value="site.swf" />
  <param name="flashvars" value="page=projects" />
  <embed src="site.swf" flashvars="page=projects"></embed>
</object>
  • Use JS ↔ ActionScript messaging for full deep linking and history support: the page monitors location.hash (or uses the hashchange event) and calls a function exposed by the SWF (via ExternalInterface) to change pages; the SWF updates the hash when navigation happens so back/forward and bookmarks work.

Example JS pattern:

window.onhashchange = function() {
  var page = location.hash.slice(1);
  var swf = document.getElementById('siteSwf');
  try { swf.navTo(page); } catch(e) {}
};

Notes and cautions: SWFAddress was the standard library for robust deep linking and history handling in Flash. Testing must be done from a web server (not file://). Important — Flash Player reached end‑of‑life in 2020 and modern browsers no longer run SWFs; for long‑term projects, migrate the site to HTML5/JS (single‑page routing with hash/history) or export from Animate CC to an HTML5 canvas and implement routing in JavaScript.

Recommended Answers

All 4 Replies

Member Avatar for Member #46692

You mean create a weblink to another page?

Please don't tell me your entire website is on one page?

Well yes, that is what the assignment at the time was. To show the "advances of Flash". That you can build the site on one .fla page and just use frame labels to seperate the pages. I mean there are some advantages and "lazy/easy" designing involved with it. But yes I want to be able to go to the address bar right now, put in the URL that will take me to one of those labeled sections or pages as seen in the browser. I'm just curious if it can be done.

Member Avatar for Member #114696

If you want to got to a keyframe in the same flash file just use

gotoAndStop(keyframe no)

or if its a webpage use

getURL(link, _target)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.