Hello Everyone,

I'm new to flash and actionscript 3. I just purchased a flash file that is driven by as3. I don't know how to embed it to my webstore's main page. Any help would be greatly appreciated.

Here is the description of the files I received with my purchase:

Flip Tab Image Rotator
Features include:

1. Driven by pure AS3 document class.
2. Optional transition style, include: cube, fade, flip
3. XML driven content.
4. Slideshow style auto display.
5. Support many file type: jpg, png, gif, and swf.
6. Unlimited amount of news can be displayed

The source folder:

* The preview.fla is the main source flash file. The TabRotator.as is the main actionscript source file. MenuList.as is used display the menu in the left side. TimeSlide.as is used for display the circle time slide. Just edit these files if you want to add more function or modify some elements. Otherwise, just coustom the news.xml in the xml folder showing below with your own content, no actionscript knowledge is needed.
* Other: swfDemo.fla is used for the demo swf file, caurina folder contains the open source tweener class, five3D folder conatins the five3D class user for the flip function.

The deploy folder:

* The images folder: contains the news images used for showing your news,
the image size right now is 430x300, and it will auto-scale to this fix size if you put different size of images. It can be many file types: include gif, jpg, png or flash file (swf);
* The icons folder: contains the small icon used for your menu list,
the size is 36x36, no autoscale here.
* Just custom news.xml in the xml folder with your own content, include your news image, news titie(the menu list), news content(support HTML). Please pay attention to the image location

The only problem is that my server only allows me to place all files into one folder but all these files are in several folders and subfolders. What do I need to do to make this work.


Recommended Answers

All 10 Replies

Well, I'm not familiar with the component you're on about, but generally the source folder and it's subfolders will contain the source files you'd need if you decided that you wanted to modify/customise the component. You don't need to put any of these files onto your server.

The stuff in the deploy folder (and any sub-folders) however will need to be copied to your server. In order for the component to work the file/directory structure on your server would have to be identical to the directory structure here.

It seems strange that you can't create sub-folders on your server....Without the appropriate files in the appropriate subfolders, your component will not work. It's as simple as that!

All you should need to do is duplicate the folder structure for the deploy folder of your component on your server, copy all of the relevant files and then embed the .swf into your page either manually with object/embed tags or by using a script like swfobject.js (a cross browser compatible script for auto detecting browser versions and embedding flash in html pages in a manner compatible with the browser - google it!)

The only other way to do it would be to edit the sources of your component so that it looks for the xml files and images in the same folder as the .swf instead of looking in the subdirectories, rebuild the component and move all of the xml files up to the root folder and then upload everything to your server and embed the .swf in your page/pages....But that's just bloody stupid IMHO. You should be able to create as many subdirectories as you need...What is stopping you from creating the subdirectories on your server??

Cheers for now,

Hello Jas,

Thank you for your reply. The web store I want to add this flash file to is hosted by yahoo. Currently, yahoo stores only have one library "/lib" folder where I can upload my files to. This folder doesn't allow sub-folders.

I will contact the programmer that made this file to see if he can do the things you suggested by putting all files in the same folder.

Thanks again.



Would you be able to upload your component and it's ancilliary folders/files to web-space on a different server and then embed the .swf into the html page in your yahoo web store?

That might get around the problem nicely!

Yes, that's exactly what I'm going to try to do.


I got it to work however, now I have two more problems to fix.

I can't open the links in the same window. I change the target field to "self" and suddenly the links and images are no longer clickable. They only work when the target is set to "blank" which opens the links in a new tab.

Second problem is the z-index of the file. Currently I have a drop down menu right above it. All the menus are displayed behind it.

Here is the index.html code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
		<title>Flip Tab Image Rotator</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<script type="text/javascript" src="swfobject.js"></script>
		<script type="text/javascript">
			var params = {};
			params.bgcolor = "#CCCCCC";
			var attributes = {};

			// demo 2
			var flashvars1 = {};
			var params1 = {};
			params1.bgcolor = "#CCCCCC";
			flashvars1.xmlPath = "ussoccer-flash-rotator.xml";
			swfobject.embedSWF("preview.swf", "content2", "610", "355", "9.0.0", "expressInstall.swf", flashvars1, params1, attributes);

				<div id="content2" >


How can I add other parameters to allow the file to open links in the same window and to decrease the z-index?

Please help!

If you've used actionscript to put everything onto the stage, then you should be aware that the display items on the stage are added on top of one another, so the first thing to be added to the stage will be at the bottom and each subsequent item added to the display list (via addChild) will appear above the previous item. So if you added the menu before the image rotator, then the menu will appear behind the rotator.

So if you're using actionscript to create the instances of the menu and the rotator you could do your initialisation of your components something like this:
(Note: this is kinda pseudo code, seeing as I don't know exactly what you're doing!)

// create an instance of the menu, but don't call addChild() yet!
menu:MenuComponent = new MenuComponent(//constructor arguments here);
// perform any additional initialisation. x,y pos etc...

// now create an instance of your rotator
rotator:RotatorComponent = new RotatorComponent(// constructor args);
// do any  additional initialisation, x,y pos etc...

// now add the rotator to the display list followed by the menu

So although we created an instance of the menu before the instance of the rotator, we called addChild on the rotator before the menu, so the menu will appear above the rotator, not behind it.... Not sure if that's what you're after?
Adding the instances to the stage in this way should negate the need to do any kind of depth sorting.

If you've used a .fla to create your movie and you've dragged instances of components onto the stage/timeline, then you can add and remove layers to the timeline in the Flash IDE and arrange things that way, so create a separate layer to house each element and put your menu component on the top layer and the rotator on the bottom layer.

Is that any kind of help??

It is possible to do depth sorting in AS3, but it seems to me that depth sorting should be unnecessary if you add everything to the display list in the appropriate order.

Like I said I hope this post is of some help, but without seeing some of the actionscript and/or .fla sources for your swf, I can't really give a definite or exact solution to either of your problems!
Cheers for now,


Thanks for the reply. I'm only using as3 for the flash rotator banner. The menu is and rest of site is in HTML. I know I had this problem in the past with flash files. Adding so.addParam("vmode", "transparent"); would fix that problem but I don't know how to do something similar this time.

Hope this makes sense.




Thanks for the reply. I'm only using as3 for the flash rotator banner. The menu is and rest of site is in HTML. I know I had this problem in the past with flash files. Adding so.addParam("vmode", "transparent"); would fix that problem but I don't know how to do something similar this time.

Hope this makes sense.



Ah, so you mean it's the z-order on the html page that is the issue, not the z-order of the items in the .swf?

Member Avatar

Query 1:
In your code also add this parameter:
// demo 2
var flashvars1 = {};
var params1 = {};

params1.bgcolor = "#CCCCCC";

Member Avatar

Here you can't able to add the code to target the window. This is just used to embed the code. That is look like the code below in your source file:

var serverpath:String="http://localhost/Raja/AS3.0 PHP/TestPHP.php";
var urlrequest:URLRequest=new URLRequest(serverpath);

Be a part of the DaniWeb community

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