Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-22-2012, 12:37 AM   #1
Registered User
Join Date: Apr 2012
Posts: 2
Default Swf xml Html form

Hello, and thanks in advance for your help, I have a swf email form with image rotator which works fine when i pull it up in localhost or just preview the swf file on my server however when I open it via the html link the logo and images wont show noob to actionscript xml/flash help pls, exp:

images and logo show via localhost and in server preview.swf just to show example


images wont show via html url


Swf Code

import flash.events.TimerEvent;
import fl.transitions.Tween;
import fl.transitions.easing.Strong;
import fl.transitions.TweenEvent;

//Variables for our image rotator
var xml:XML;
var imagesVector:Vector.<Loader> = new Vector.<Loader>();
var urlLoader:URLLoader;
var imagesCounter:Number=0;
var timer:Timer;
var indexCounter:Number=0;
var lastCount:int;
var tween:Tween;
var addTween:Tween;
var loader:Loader = new Loader();


// Loading XML Data
function loadXML(url:String):void {
urlLoader=new URLLoader(new URLRequest(url));
urlLoader.addEventListener(Event.COMPLETE, parseXML);

// Processing XML Data
function parseXML(e:Event):void {
xml=new XML(e.target.data);
timer = new Timer(xml.@period);

if (xml.children().length()==1){
} else {


//Block of code that is needed, when there is just one image in XML file//
function loadImage():void {
loader.load(new URLRequest(xml.children().@src));
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, imageLoaded);

function imageLoaded(e:Event):void {
addTween=new Tween(loader,"alpha",Strong.easeInOut,0,1,0.5,true );
addTween=new Tween(preloader,"alpha",Strong.easeInOut,1,0,0.5,t rue);
// Function that loads images
function loadImages():void {
for (var i:int = 0; i < xml.children().length(); i++) {
var imagesLoader:Loader = new Loader();

imagesLoader.load(new URLRequest(xml.children()[i].@src));


imagesLoader.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, loaderStatus);

// Function that starts animation when all images is loaded
function loaderStatus(e:Event):void {

if (imagesCounter==imagesVector.length) {
timer.addEventListener(TimerEvent.TIMER, imageChange);

// Function that keep images changing
function imageChange(e:Event):void {

tween=new Tween(imagesVector[indexCounter],"alpha",Strong.easeInOut,1,0,1,true);
tween.addEventListener(TweenEvent.MOTION_FINISH,re turnImageDepth);

if (indexCounter==imagesVector.length) {

//Sets last image backwards and makes it visible
function returnImageDepth(e:TweenEvent):void {
images_con.setChildIndex(imagesVector[lastCount], 0);

//Makes all images visible when they added into the stage, also makes preloader invisible
function returnVectorDepth(e:TweenEvent):void {
for (var i:int=1 ; i < imagesVector.length ; i++) {
addTween=new Tween(preloader,"alpha",Strong.easeInOut,1,0,0.5,t rue);

//Adds images to stage with smooth animation
function addImages():void {
for (var i:int = imagesVector.length - 1; i >= 0; i--) {
addTween=new Tween(imagesVector[indexCounter],"alpha",Strong.easeInOut,0,1,0.5,true);
addTween.addEventListener(TweenEvent.MOTION_FINISH , returnVectorDepth);

bobafett07 is offline   Reply With Quote
Old 04-22-2012, 01:23 PM   #2
Registered User
Join Date: Apr 2012
Posts: 2

looked up history on here for similar issue still a lost just need a good push in the right direction
bobafett07 is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump

All times are GMT. The time now is 04:17 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.