XML and Flash 8, Windows XP
I'm using XML to create a gallery in Flash. All is working
well, however I wish to create a link in the XML file which opens
and additional swf file in a new window which retains the exact
dimensions of the swf file. Is this possible?
Any tips and ticks would be greatly received.
Thanks
I have not tried with Flash8 but you used to be able to put
javascript inside your call to getURL(). Look at the this page for
code examples that use window.open javascript calls in the flash
getURL function call:
http://flashmx2004.com/forums/lofiversion/index.php/t7130.html
Note that I have run into issues with browser compatibility
doing this. So in case problems arise try using the Exteranl
Interface API which will allow you to talk directly to javacript in
your html.
Similar Messages
-
Adding CDATA to an existing xml and flash asset
Hi, I am a front end web designer/developer and
analyst...struggling with putting an accordian flash xml menu
together. I have it done except I need to add a simple trademark
symbol circle with r. I am struggling with how to do this since I
am not savvy in actioncript. I assume the best way is to add it is
with a CDATA child node, but do not know how or whatever is the
best way to get this done since am on a tight deadline. I need
someone to explain step by step what I have to do to get this
simple addition resolved. Attached are the links to home page and
code for the xml file. The left navigation is the asset that I need
to add the trademark symbol under about, about ADHERE. Thanks so
much in advance!!!!!!
[URL=http://www.nodcreative.com/natrecor_sliced/natrecor_index.html]index
page with flash xml menu asset[/URL]
xml code:
<?xml version="1.0" encoding="UTF-8"?>
<accodion>
<item name="HOME">
</item>
<item name="ABOUT">
<item name= "ABOUT
ADHERE<![CDATA[write]]>"></item>
<item name="Medical Information" url="
http://www.jnj.com?ref=Random">
</item>
<item name="About SCIOS" url="
http://www.jnj.com?ref=Random">
</item>
</item>
<item name="INTERACTIVE DOSING INFORMATION">
<item name="Indications and Usage" url="
http://www.jnj.com?ref=Random"></item>
<item name="Contraindications" url="
http://www.jnj.com?ref=Random"></item>
<item name="Warnings" url="
http://www.jnj.com?ref=Random"></item>
<item name="Dosage and Administration" url="
http://www.jnj.com?ref=Random"></item>
</item>
<item name="RESOURCES AND TOOLS">
<item name="NATRECOR PI" url="
http://www.jnj.com?ref=Random"></item>
<item name="About Heart Failure" url="
http://www.jnj.com?ref=Random"></item>
<item name="Stages of Heart Failure" url="
http://www.jnj.com?ref=Random"></item>
<item name="NATRECOR Dosing Information" url="
http://www.jnj.com?ref=Random"></item>
<item name="Patient Management Resources" url="
http://www.jnj.com?ref=Random"></item>
</item>
<item name="US PRESCRIBING INFORMATION">
</item>
<item name="IMPORTANT SAFETY INFORMATION
ref=http://www.jnj.com">
</item>
<item name="REGISTRATION ref=http://www.jnj.com">
</item>
</accodion>
FLASH actionscript is as follows:
// The accordion
var accordion = this
// The item list
var itemList = []
// SETTINGS
//-------------PROPERTIES----------------
// Separation between the buttons
var separation = 1.5
// Tabulation between the buttons and the margin
var tabulation = 10
// if true, it cant be more than one items opened at the same
time (only for the first buttons, POWERFUL, MENU ,ACCORDION, ets).
var autoClose = true
// if true, it cant be more than one subItems opened at the
same time.
var subItemAutoClose = true
// if true, open and close all the subItems at the same time.
var openAll = false
// The height of the button
var itemHeight = 21
// The width of the button
var itemWidth = 230
// If true, show the light over the button
var light = true
// The ease of the menu opening
var openEase = 2.5
// The ease of the menu closing
var closeEase = 2.5
// The rollOut color fade speed
var rollOutFade = 8
//-------------COLORS----------------
// The color of the button
var buttonColor = 0xa
// The roll over color
var rollOverColor = 0xCCCCCC
// The arrow color
var arrowColor = 0xCCCCCC
// The arrow color on roll over
var rollOverArrowColor = 0x000000
// The text color
var TextColor = 0xFFFFFF
// The text color on roll over
var rollOverText = 0x000000
// LOADING XML
// The xml data
var xmlSource:XML = new XML
// Loading the xml
xmlSource.onLoad = function(success:Boolean):Void {
// When the load finishs...
if (success) {
// The first node of the xml
xmlRoot = xmlSource.firstChild
// The item nodes
xmlItems = xmlRoot.childNodes
// The total of items
total = xmlItems.length
// Creating the buttons
for (i=0; i<total; i++){
// Attaching the buttons
accordion.attachMovie("item", "item" + i, i)
// The button reference
itemList
= accordion["item"+i]
// The first node of the item node
itemList.xmlRoot = xmlItems
// The separation between subitems
itemList.separation = separation
// Tabulation between the subitems and the margin
itemList
.tabulation = tabulation
// subItems auto close
itemList.subItemAutoClose = subItemAutoClose
// The subitems height
itemList
.itemHeight = itemHeight
// The subitems width
itemList.itemWidth = itemWidth
// shows/hides the subitems light
itemList
.light = light
// The subitems color
itemList.buttonColor = buttonColor
// The roll over color
itemList
.rollOverColor = rollOverColor
// The arrow color
itemList.arrowColor = arrowColor
// the arrow color on roll over
itemList
.rollOverArrowColor = rollOverArrowColor
// The text color
itemList.TextColor = TextColor
// The roll over text color
itemList
.rollOverText = rollOverText
// the opening easing
itemList.openEase = openEase
// The closing easing
itemList
.closeEase = closeEase
// The roll over fade speed
itemList.rollOutFade = rollOutFade
// open all
itemList
.openAll = openAll
// ignore white
xmlSource.ignoreWhite = true;
// Loads the .xml file
xmlSource.load("accordion.xml");
// Aligning the items each one below the other
this.onEnterFrame=function(){
// Does the align to ALL the items
for (i=1; i<total; i++){
// Aligning the items
itemList._y = itemList[i-1]._y +
itemList[i-1].mask._height + itemList[i-1].button._height +
separation
// The cursor position
cursor._x = _xmouse
cursor._y = _ymouse
// Opens the items
onMouseDown = function (){
// Does this to all the buttons
for (i=0; i<total; i++){
// If is clicked
if (itemList
.button.hitTest(cursor)){
// Shows the current item
showCurrent(itemList)
// Shows the button clicked
showCurrent=function(current){
// Does this to all the buttons
for (i=0; i<total; i++){
// Does this to all the buttons exept the clicked
if (itemList
!=current){
// Close the other items if autoclose = true
if (autoClose){
// Close the other items
itemList.openBox=false
// fades the roll over effect of the other items
itemList
.over = false
//Does this to the clcked item only
} else {
// If it has sub items
if (total>0){
//Hides them if its open
if (itemList.openBox){
itemList
.openBox=false
//Shows them if its closed
} else {
itemList.openBox=true
// If it has no subitems goes to the link
} else {
getURL(xmlRoot.attributes.url, _self)Please don't cross-post in a bunch of forums. Also when
adding code to a post, please use the attach code button. That
keeps the formatting and makes it easier to read. Your code is far
too long and way to unformatted to really understand quickly.
I don't know why you would need a CDATA node to get the
registered symbol. If the XML file you are working with is saved as
unicode (UTF-8) the symbol should come across just fine. Just
putting the UTF-8 at the beginning doesn't tell whatever program
you are using to save as UTF-8!
Do you know how to make the registered symbol? On windows it
is ALT -0174 (use the keypad for those numbers).
Once you've got the symbol in your XML the next step is to
check if Flash is loading it correctly. When you are in the testing
environment go to the Debug menu and select List Variables. The
trace window will show all the variables -- and there are probably
a lot! Search/Find something close to the symbol and see if the
trace window shows the symbol correctly. If it does then Flash is
readying it correctly and if it isn't showing you have problems
with your textfield. If it isn't showing correctly then your XML
file isn't UTF-8.
If it is textfield problems I wouldn't know what to do since
it is inside a component. Post back with your findings. -
Internet Explorer 11 and Flash on Windows Server 2012 R2
I used Windows Server 2012 R2 which has built within it Internet Explorer version 11. When loading a web site which has Flash content it prompts me to install Flash, but when I navigate to the Flash download site it says I must enable it because it is already installed.
After reviewing the directions for How to Enable Flash, the directions become worthless because they don't match the screen that I see.
QUESTIONS:
Does IE Version 11 have Flash built in or not?
If if does, how do I enable Flash?
If it doesn't, how do I install Flash?
Please don't tell me to load a media-rich web site, and go to "Manage Add-Ons" and enable Flash because the enable Flash command doesn't show up.Repair IE? http://support.microsoft.com/kb/318378
The thing is... Adobe collaborates with MS on the updates for IE10 &11 in Win8 &8.1 (server 2012 also AFAIK) and then hands the code off to them. It's "Redmond's baby" after that. There's a KB in Windows updates (KB2898108) that prevents downloading the ActiveX plugin throug Adobe updater from here. Even if you manually download it, it'll prevent you from installing it. I have a Win 8 and Win 8.1 test machine set up and I've tried to uninstall the KB with no success.
Unfortunately I don't have a Server 2012 machine so it limits my troubleshooting. Chris Campbell has more insight into the ins and outs of Server 2012. Hopefully he'll add to this thread. -
Issue w/ new Laptop and Flash in Windows 8/Firefox 23
Maybe someone can help me with a similar issue. I am running Windows 8 64 bit, firefox 23.0.1 on a brand new Asus laptop, 3rd gen Intel I7. I currently have Flas 11.8.x installed and enabled as well as shockwave. Some pages that seem to use Flash, like Google Play, work just fine. However, others do no display any content. They do not display the crash logo (w/ the sad fave lego block), I get only a blank (white or sometimes black) space. If I right clock on this space, I get a greyed out option displaying the message "Flash movie not loaded" and an enabled button that read "About Flashplayer 11.8.x".
For example, Yahoo Fantasy Football draft room will not load, neither will the flash test video at http://helpx.adobe.com/flash-player/kb/find-version-flash-player.html. I tooke my computer back to TigerDirect for them to take a look at it, and while the Tech there said he didn't know what to tell me, he also said he was sure it was a software issue. That being said, my GPU is Nvidia geforce GTX 670MX.
I have also tried to run Firefox in compatibility mode in WIndows 7 and XP, and in both these instances, with updated flash, I at leas can get a "Flash Has Crashed" graphic in the instances that flash is not displaying. I have also tried loading flash in IE10, Chrome and Opera to the same issues. If anyone has any help, please let me know.
p.s. sorry for the double post, thought I should create a new thread for this.You don't need to install Flash Player on IE10/Windows 8; it's already preinstalled.
For more information see http://helpx.adobe.com/flash-player/kb/flash-player-issues-windows-8.html -
I recently got interested in flash and dove right into with a
flash template. I have been editing it having some success, but now
I am having problems. I'm trying to use a simple photo gallery and
the template didn't come with a caption for the pictures so I added
a dynamic text box and attempted to use AS. Basically I was trying
to make it when you moused over the picture the caption appeared
with the text from the XML files. All I can get to come up is
undefined when I mouse over it. Here is my AS script, what I
added is in red so the problem is probably around it.Off the bat I can see a syntax error:
_root.desc = photo_caption[this._parent.tn.no];
should be:
_root.desc = photo_caption[this._parent.tn_no];
with an underscore -
HELP!
I think I might be in trouble unless someone brilliant can help.
I'm working with a flash template that loads external images and text using an xml file.
Everything works well the only problem is I've promised a client that as well as a "title" and "description" I will also include a clickable URL link. I can edit the flash to a certain extent but I am having a nightmare of a time including a clickable url. Is there anyone out there who can help?
"photo_description", "photo_title" and "photo_url" are the names of the dynamic text fields.
XML snippet looks a little like this...
<title>Title</title>
<description>Description</description>
<url>http://</url> <---- This is the part I'd like to include
Here is the AS...
// Copyright © flashmo.com
// Developed by Min Thu
// Tweener
// http://code.google.com/p/tweener/
import caurina.transitions.*;
var folder:String = "photos/";
var follow_mouse:Boolean = true; // true OR false
var tween_duration:Number = 0.5;
var default_tn_scale:Number = 0.8;
var default_pic_alpha:Number = 0.25;
var new_scale:Number;
var tn_border:Number = 5;
var speed:Number = 12; // from 1 to 20
var i:Number;
var j:Number;
var tn:Number = 0;
var tn_distance:Number;
var current_no:Number = 0;
var total:Number;
var flashmo_xml:XML;
var flashmo_photo_list = new Array();
var current_mc:MovieClip = new MovieClip();
var flashmo_pic:MovieClip = new MovieClip();
var thumbnail_group:MovieClip = new MovieClip();
this.addChild(flashmo_pic);
this.addChild(thumbnail_group);
this.addChild(flashmo_text_info);
flashmo_pic.alpha = default_pic_alpha;
flashmo_pic.x = flashmo_photo_area.x;
flashmo_pic.y = flashmo_photo_area.y;
flashmo_pic.mask = flashmo_photo_area;
thumbnail_group.x = 100;
thumbnail_group.y = flashmo_thumbnail_area.y;
thumbnail_group.mask = flashmo_thumbnail_area;
loading_info.text = "";
thumbnail_info.text = "";
flashmo_photo_title.text = "";
flashmo_text_info.alpha = 0;
flashmo_text_info.photo_title.text = "";
flashmo_text_info.photo_description.text = "";
if( Math.abs(speed) > 20 ) speed = 10;
speed = Math.abs(speed);
function load_gallery(xml_file:String):void
var xml_loader:URLLoader = new URLLoader();
xml_loader.load( new URLRequest( xml_file ) );
xml_loader.addEventListener(Event.COMPLETE, create_thumbnail);
function create_thumbnail(e:Event):void
flashmo_xml = new XML(e.target.data);
total = flashmo_xml.photo.length();
for( i = 0; i < total; i++ )
flashmo_photo_list.push( {
thumbnail: flashmo_xml.photo[i].thumbnail.toString(),
filename: flashmo_xml.photo[i].filename.toString(),
title: flashmo_xml.photo[i].title.toString(),
description: flashmo_xml.photo[i].description.toString()
load_photo();
load_tn();
function load_photo():void
var pic_request:URLRequest = new URLRequest( folder + flashmo_photo_list[current_no].filename );
var pic_loader:Loader = new Loader();
pic_loader.load(pic_request);
pic_loader.contentLoaderInfo.addEventListener(Prog ressEvent.PROGRESS, on_photo_progress);
pic_loader.contentLoaderInfo.addEventListener(Even t.COMPLETE,on_photo_loaded);
flashmo_text_info.photo_title.text = flashmo_photo_list[current_no].title;
flashmo_text_info.photo_description.text = flashmo_photo_list[current_no].description;
flashmo_pic.alpha = 0;
function unload_photo():void
flashmo_pic.removeChildAt(0);
load_photo();
function on_photo_progress(erogressEvent):void
var percent:Number = Math.round(e.bytesLoaded / e.bytesTotal * 100);
loading_info.text = "Loading Image... " + percent + "%";
function on_photo_loaded(e:Event):void
loading_info.text = "";
flashmo_pic.addChild( Bitmap(e.target.content) );
flashmo_pic.addEventListener( MouseEvent.MOUSE_OVER, pic_over );
flashmo_pic.addEventListener( MouseEvent.MOUSE_OUT, pic_out );
Tweener.addTween( flashmo_pic, { alpha: default_pic_alpha, time: tween_duration, transition: "easeOutQuart" } );
thumbnail_group.addEventListener( MouseEvent.MOUSE_OVER, pic_over );
function load_tn():void
var pic_request:URLRequest = new URLRequest( folder + flashmo_photo_list[tn].thumbnail );
var pic_loader:Loader = new Loader();
pic_loader.load(pic_request);
pic_loader.contentLoaderInfo.addEventListener(Even t.COMPLETE, on_thumbnail_loaded);
tn++;
thumbnail_info.text = "Loading Thumbnail " + tn + " of " + total;
if( tn == 8 )
thumbnail_group.addEventListener( Event.ENTER_FRAME, fisheye_thumbnails );
function on_thumbnail_loaded(e:Event):void
var flashmo_tn_bm:Bitmap = new Bitmap();
var flashmo_tn_mc:MovieClip = new MovieClip();
flashmo_tn_bm = Bitmap(e.target.content);
flashmo_tn_bm.x = - flashmo_tn_bm.width * 0.5;
flashmo_tn_bm.y = - flashmo_tn_bm.height;
flashmo_tn_bm.smoothing = true;
var bg_width:Number = flashmo_tn_bm.width + tn_border * 2;
var bg_height:Number = flashmo_tn_bm.height + tn_border * 2;
flashmo_tn_mc.graphics.beginFill(0xFFFFFF);
flashmo_tn_mc.graphics.drawRect( - bg_width * 0.5, - bg_height + tn_border, bg_width, bg_height );
flashmo_tn_mc.graphics.endFill();
flashmo_tn_mc.addChild(flashmo_tn_bm);
flashmo_tn_mc.buttonMode = true;
flashmo_tn_mc.addEventListener( MouseEvent.MOUSE_OVER, tn_over );
flashmo_tn_mc.addEventListener( MouseEvent.MOUSE_OUT, tn_out );
flashmo_tn_mc.addEventListener( MouseEvent.CLICK, tn_click );
flashmo_tn_mc.name = "flashmo_" + thumbnail_group.numChildren;
flashmo_tn_mc.x = thumbnail_group.numChildren * 80;
flashmo_tn_mc.y = 110;
flashmo_tn_mc.scaleX = flashmo_tn_mc.scaleY = default_tn_scale;
thumbnail_group.addChild(flashmo_tn_mc);
if( tn < total )
load_tn();
else
thumbnail_info.text = "";
function tn_over(e:MouseEvent):void
var mc:MovieClip = MovieClip(e.target);
var s_no:Number = parseInt(mc.name.slice(8,10));
if( s_no > 1 )
thumbnail_group.addChild( thumbnail_group.getChildByName("flashmo_" + (s_no-2) ) );
if( s_no > 0 )
thumbnail_group.addChild( thumbnail_group.getChildByName("flashmo_" + (s_no-1) ) );
if( s_no < thumbnail_group.numChildren - 2 )
thumbnail_group.addChild( thumbnail_group.getChildByName("flashmo_" + (s_no+2) ) );
if( s_no < thumbnail_group.numChildren - 1 )
thumbnail_group.addChild( thumbnail_group.getChildByName("flashmo_" + (s_no+1) ) );
thumbnail_group.addChild(mc);
flashmo_photo_title.text = flashmo_photo_list[s_no].title;
function tn_out(e:MouseEvent):void
var mc:MovieClip = MovieClip(e.target);
thumbnail_group.addChild(mc);
flashmo_photo_title.text = "";
function tn_click(e:MouseEvent):void
var mc:MovieClip = MovieClip(e.target);
current_no = parseInt(mc.name.slice(8,10));
Tweener.addTween( flashmo_pic, { alpha: 0, time: tween_duration,
transition: "easeInQuart", onComplete: unload_photo } );
flashmo_pic.removeEventListener( MouseEvent.MOUSE_OVER, pic_over );
flashmo_pic.removeEventListener( MouseEvent.MOUSE_OUT, pic_out );
thumbnail_group.removeEventListener( MouseEvent.MOUSE_OVER, pic_over );
flashmo_text_info.addEventListener( MouseEvent.MOUSE_OVER, info_over );
flashmo_text_info.addEventListener( MouseEvent.MOUSE_OUT, info_out );
function pic_over(e:MouseEvent):void
Tweener.addTween( flashmo_pic, { alpha: default_pic_alpha, time: tween_duration, transition: "easeIn" } );
Tweener.addTween( thumbnail_group, { alpha: 1, time: tween_duration, transition: "easeOut" } );
function pic_out(e:MouseEvent):void
Tweener.addTween( flashmo_pic, { alpha: 1, time: tween_duration, transition: "easeOut" } );
Tweener.addTween( thumbnail_group, { alpha: 0, time: tween_duration, transition: "easeIn" } );
function info_over(e:MouseEvent):void
Tweener.addTween( flashmo_pic, { alpha: 1, time: tween_duration, transition: "easeOut" } );
Tweener.addTween( thumbnail_group, { alpha: 0, time: tween_duration, transition: "easeIn" } );
Tweener.addTween( flashmo_text_info, { alpha: 1, time: tween_duration, transition: "easeIn" } );
function info_out(e:MouseEvent):void
Tweener.addTween( flashmo_text_info, { alpha: 0, time: tween_duration, transition: "easeOut" } );
function fisheye_thumbnails(e:Event):void
thumbnail_group.x -= ( mouseX - flashmo_thumbnail_area.width * 0.5 ) * 0.005 * speed;
if( thumbnail_group.x > flashmo_thumbnail_area.x + 100 )
thumbnail_group.x = flashmo_thumbnail_area.x + 100;
else if( thumbnail_group.x < flashmo_thumbnail_area.x - thumbnail_group.width + flashmo_thumbnail_area.width )
thumbnail_group.x = flashmo_thumbnail_area.x - thumbnail_group.width + flashmo_thumbnail_area.width;
if( mouseY > flashmo_thumbnail_area.y && mouseY < flashmo_thumbnail_area.y + flashmo_thumbnail_area.height )
for( j = 0; j < thumbnail_group.numChildren; j++ )
current_mc = MovieClip(thumbnail_group.getChildAt(j));
tn_distance = Math.sqrt(
Math.pow( Math.abs( mouseX - (current_mc.x + thumbnail_group.x) ) , 2)
+ Math.pow( Math.abs( mouseY - (current_mc.y + thumbnail_group.y) ) , 2)
new_scale = 1.1 - ( tn_distance * 0.002 );
current_mc.scaleX += (new_scale - current_mc.scaleX) * 0.2;
current_mc.scaleY += (new_scale - current_mc.scaleY) * 0.2;
if( current_mc.scaleX < default_tn_scale )
current_mc.scaleX = current_mc.scaleY = default_tn_scale;
else
for( j = 0; j < thumbnail_group.numChildren; j++ )
current_mc = MovieClip(thumbnail_group.getChildAt(j));
current_mc.scaleX += (default_tn_scale - current_mc.scaleX) * 0.2;
current_mc.scaleY += (default_tn_scale - current_mc.scaleY) * 0.2;
Thank you! Thank you! Thankyou!I´m not quite understanding what you are trying to do here, but in my opinion it would be cleverer to let Flash handle the Link and not the XML.
Look into the navigateToURL function, formerly (AS2) known as getURL.
Include your server path as a variable like:
var baseurl = 'http://www.mypictures.com/descriptions/';
and in your MouseEventListeners build the path dynamically:
var descriptionURL:String = aHref();//write a function to get the right Link here;
var request:URLRequest = new URLRequest(baseurl + descriptionURL);
try{
navigateToURL(request,"_blank");
catch(e:Error){
trace("An error occurred");
in your XML you will now only need sth. like <description>description.txt</description> -
I am new to flash's dynamic data uses - I have a 100
responses to 23 question form which I wish to display using flash
in a presentation - I wish to sort the info only by either
individuals forms or question/answers. Once created i do not need
to amend the data - i will be delivering this on a cd.
Could I add the 100 responses into an XML File for flash to
read the data from? Is it easy to sort this information?
I just used jen de hanns tutorial with the data wizards - is
this appropriate - or is what I am wanting to do more complex?
Many thanks for any adviceSorting of data can be done by a database which you are not
using, a
serverside script which you are not using, in your own AS
code or possibly
an Flash UI component.
You might want to post this message in the Flash Actionscript
forum and ask
how you can sort data in As or UI components.
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
"stacyp" <[email protected]> wrote in
message
news:e2371n$n00$[email protected]..
I am new to flash's dynamic data uses - I have a 100
responses to 23
question
form which I wish to display using flash in a presentation -
I wish to sort
the
info only by either individuals forms or question/answers.
Once created i do
not need to amend the data - i will be delivering this on a
cd.
Could I add the 100 responses into an XML File for flash to
read the data
from? Is it easy to sort this information?
I just used jen de hanns tutorial with the data wizards - is
this
appropriate
- or is what I am wanting to do more complex?
Many thanks for any advice -
In over my head--XML and Flash
Hi,
I'm relatively new to Flash and I (foolishly) said that I
could add a simple link at the end of an existing Flash file. The
link is no problem, but the movie calls all of its text from an XML
file. While I'm awed by how this works, I'm also stumped--I can't
get the movie to actually display the text. Here's the bit of
actionscript that refers to the XML file in question:
_level0.displayMode_str="loaded";
launchFile_str="advice";
launchFolder_str=""
xmlFileToLoad = "advice_AM.xml";
commonFolder_str = "./commonFiles/";
#include "loader.as"
I'm pretty sure that it's finding the XML file ok, as it's
pulling one or two headings from it, but nothing else. I know this
isn't much to go on, but you guys are my only hope. Is there
something basic I'm missing?
Thanks in advance!SAVING Flash (AS3) data to XML - Stack Overflow
-
Kirupa Photo Gallery using XML and Flash
I learn best by using tutes and figuring out how to make
changes effectively. i finished the one at
http://www.kirupa.com/developer/mx2004/thumbnails3.htm
and managed to change sizes etc but i wanted to change it to a
symbol to insert it in another flash file. i got that part done
though the thumbs show up (number 3 to 5) and they do not scroll. i
figure it has to do with the hit left and hit right and that the
"path" not sure if i used the term in the right way changes when it
turns from a scene all by itself to being inserted into a frame in
a layer. i am not sure if i am explaining this right but i would
really appreciate any help and I am sorry if this is a duplicate
post, i have been searching for a long time and cannot find it or
figure it out.
jmontymanI learn best by using tutes and figuring out how to make
changes effectively. i finished the one at
http://www.kirupa.com/developer/mx2004/thumbnails3.htm
and managed to change sizes etc but i wanted to change it to a
symbol to insert it in another flash file. i got that part done
though the thumbs show up (number 3 to 5) and they do not scroll. i
figure it has to do with the hit left and hit right and that the
"path" not sure if i used the term in the right way changes when it
turns from a scene all by itself to being inserted into a frame in
a layer. i am not sure if i am explaining this right but i would
really appreciate any help and I am sorry if this is a duplicate
post, i have been searching for a long time and cannot find it or
figure it out.
jmontyman -
A few questions with XML and Flash
Hi there.
I am currently trying to create a 3d carousel using AS2 and XML. I've made a lot of progress, but there ar e few things I am still struggling with and was hopoing that someone here could please steer me in the right direction.
Here is a URL where the Carousel can be found:
http://iongeo.com/ru_innovation_test_dev/carousel_test.html
Here are a few of the things I am wondering:
1. I would like to be ablle to add a back button movide clip, similar to how the tooltip movie clip is presented now; this movie clip would be able to allow users to go back home to the caousel. I can't seem to get it to load correctly however, I would imagine that it would be set up similarly to how the tooltip icon is set up now, but to be able to have an alpha of 100 when the text is loaded in.
2. I was also wondering how I mihgt be able to add links to my .xml document to be able to call in URLs on the web. I've tried several things using the CDATA approach, but can't seem to get it to work.
I would greatly appreciate any assistance privded and am very greatful for any consideration thac ould be provided. Please let me know if there is anything htat I should clarify on.
Below is my code for AS2 and XML so that you might see how things are currently working.
import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;
var numOfItems:Number;
var radiusX:Number = 200;
var radiusY:Number = 75;
var centerX:Number = 300;
var centerY:Number = 150;
var speed:Number = 0.00;
var perspective:Number = 20;
var home:MovieClip = this;
theText._alpha = 0;
theHeader._alpha = 0;
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",8000);
tooltip._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.content = nodes[i].attributes.content;
t.header = nodes[i].attributes.header;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
function over()
//BONUS Section
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
function out()
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
function released()
//BONUS Section
home.tooltip._alpha = 100;
for(var i=0;i<numOfItems;i++)
var t:MovieClip = home["item"+i];
t.xPos = t._x;
t.yPos = t._y;
t.theScale = t._xscale;
delete t.icon.onRollOver;
delete t.icon.onRollOut;
delete t.icon.onRelease;
delete t.onEnterFrame;
if(t != this._parent)
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
else
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,100,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,200,1,true);
var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
theText.text = t.content;
var s:Object = this;
tw.onMotionStopped = function()
s.onRelease = unReleased;
function unReleased()
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();
delete this.onRelease;
var tw:Tween = new Tween(theText,"_alpha",Strong.easeOut,100,0,0.5,true);
for(var i=0;i<numOfItems;i++)
var t:MovieClip = home["item"+i];
if(t != this._parent)
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
else
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
tw.onMotionStopped = function()
for(var i=0;i<numOfItems;i++)
var t:MovieClip = home["item"+i];
t.icon.onRollOver = Delegate.create(t.icon,over);
t.icon.onRollOut = Delegate.create(t.icon,out);
t.icon.onRelease = Delegate.create(t.icon,released);
t.onEnterFrame = mover;
function moveTip()
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
xml.load("icons.xml");
function mover()
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (this._y - perspective) /(centerY+radiusY-perspective);
this._xscale = this._yscale = s*100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
this.onMouseMove = function()
speed = (this._xmouse-centerX)/8000;
// inactive mouse time (in seconds) to start slowing the carousel
var inactiveMouseTime:Number =1;
// rate of slowing carousel;
var speedDamp:Number = .4;
var speedI:Number;
var startSlowTO:Number;
this.onMouseMove = function(){
clearInterval(speedI);
clearTimeout(startSlowTO);
startSlowTO = setTimeout(startSlowF,inactiveMouseTime);
speed = (this._xmouse-centerX)/8000;
function startSlowF(){
clearInterval(speedI);
speedI=setInterval(speedF,2000);
function speedF(){
speed = speedDamp*speed;
if(speed<.1){
clearInterval(speedI);
speed=0;
Here is an example of how things are loaded from XML:
<icons>
<icon image="Denver_test_icon.png" tooltip="Denver Icon Test" header="test header" content="Test Paragraph. Greeked:. Suspendisse condimentum sagittis luctus." />
</icons>Hi there.
I am currently trying to create a 3d carousel using AS2 and XML. I've made a lot of progress, but there ar e few things I am still struggling with and was hopoing that someone here could please steer me in the right direction.
Here is a URL where the Carousel can be found:
http://iongeo.com/ru_innovation_test_dev/carousel_test.html
Here are a few of the things I am wondering:
1. I would like to be ablle to add a back button movide clip, similar to how the tooltip movie clip is presented now; this movie clip would be able to allow users to go back home to the caousel. I can't seem to get it to load correctly however, I would imagine that it would be set up similarly to how the tooltip icon is set up now, but to be able to have an alpha of 100 when the text is loaded in.
2. I was also wondering how I mihgt be able to add links to my .xml document to be able to call in URLs on the web. I've tried several things using the CDATA approach, but can't seem to get it to work.
I would greatly appreciate any assistance privded and am very greatful for any consideration thac ould be provided. Please let me know if there is anything htat I should clarify on.
Below is my code for AS2 and XML so that you might see how things are currently working.
import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;
var numOfItems:Number;
var radiusX:Number = 200;
var radiusY:Number = 75;
var centerX:Number = 300;
var centerY:Number = 150;
var speed:Number = 0.00;
var perspective:Number = 20;
var home:MovieClip = this;
theText._alpha = 0;
theHeader._alpha = 0;
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",8000);
tooltip._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.content = nodes[i].attributes.content;
t.header = nodes[i].attributes.header;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
function over()
//BONUS Section
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
function out()
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
function released()
//BONUS Section
home.tooltip._alpha = 100;
for(var i=0;i<numOfItems;i++)
var t:MovieClip = home["item"+i];
t.xPos = t._x;
t.yPos = t._y;
t.theScale = t._xscale;
delete t.icon.onRollOver;
delete t.icon.onRollOut;
delete t.icon.onRelease;
delete t.onEnterFrame;
if(t != this._parent)
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
else
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,100,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,200,1,true);
var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
theText.text = t.content;
var s:Object = this;
tw.onMotionStopped = function()
s.onRelease = unReleased;
function unReleased()
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();
delete this.onRelease;
var tw:Tween = new Tween(theText,"_alpha",Strong.easeOut,100,0,0.5,true);
for(var i=0;i<numOfItems;i++)
var t:MovieClip = home["item"+i];
if(t != this._parent)
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
else
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
tw.onMotionStopped = function()
for(var i=0;i<numOfItems;i++)
var t:MovieClip = home["item"+i];
t.icon.onRollOver = Delegate.create(t.icon,over);
t.icon.onRollOut = Delegate.create(t.icon,out);
t.icon.onRelease = Delegate.create(t.icon,released);
t.onEnterFrame = mover;
function moveTip()
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
xml.load("icons.xml");
function mover()
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (this._y - perspective) /(centerY+radiusY-perspective);
this._xscale = this._yscale = s*100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
this.onMouseMove = function()
speed = (this._xmouse-centerX)/8000;
// inactive mouse time (in seconds) to start slowing the carousel
var inactiveMouseTime:Number =1;
// rate of slowing carousel;
var speedDamp:Number = .4;
var speedI:Number;
var startSlowTO:Number;
this.onMouseMove = function(){
clearInterval(speedI);
clearTimeout(startSlowTO);
startSlowTO = setTimeout(startSlowF,inactiveMouseTime);
speed = (this._xmouse-centerX)/8000;
function startSlowF(){
clearInterval(speedI);
speedI=setInterval(speedF,2000);
function speedF(){
speed = speedDamp*speed;
if(speed<.1){
clearInterval(speedI);
speed=0;
Here is an example of how things are loaded from XML:
<icons>
<icon image="Denver_test_icon.png" tooltip="Denver Icon Test" header="test header" content="Test Paragraph. Greeked:. Suspendisse condimentum sagittis luctus." />
</icons> -
On a computer running Windows 8 Enterprise, Adobe Reader 11.0.03, and Flash Player 11.8.800.94, I am unable to open a flash-enabled PDF. Reader gives me the error "To view the Flash technology content in this PDF file, please install this version of Flash Player that supports Adobe Reader and Acrobat." Adobe's Flash verification page shows me that Flash Player is working, and I can open other basic PDFs in Reader. I have another machine with an identical setup, except that it has Acrobat 11.0.03 instead of Reader, and the PDF opens just fine on that machine. Why won't Reader open the Flash-enabled PDF?
http://helpx.adobe.com/acrobat/kb/reader-acrobat-flash-player-download.html
-
Flash 10, Windows 7 and all browsers = crash of the browser HELP
I have Win 7 Ultimate edition, did a clean install last night. I have tried Flash with IE8 32 & 64 versions, Fire Fox and Safari all with similar results.
I am trying to complete Flash Based learning lessons for work to give you an idea of what I am trying to accomplish.
the problems are as follows:
IE8- Both Versions- I can run through the entire presentation but once I click finish to close out the browser crahes and the flags are Browser and Flash
stopped working I tried the remedies windows produced for me with no results.
FireFox- Problem- The window opens and I can see the presentation but the navigation buttons have no button just the words INVALID
Safari- Problem- The presentation shows up with all navigation buttons but I am not able to click any of them, the only option that works is the windows close button
I have tried reinstalling by downloading from each different browser, I have tried a system restore to last night right after my windos install, I have tried stopping the processes in msconfig (which was a soltuion in another thread) and a few other things (nothing too technical). I asked one of the IT guys in the office about it and of course didn't have time to toubleshoot it for me before he went to lunch, his responce was dam thats wierd.
Any help from the forum would be greatly appreciated.We've been fighting this problem FOREVER!!
Why doesn't Adobe simply come out with a "Troubleshooter/Personal Settings" Inspector Program?
That way, I would start that program & it would analyze my op system, browser & version, current flashplayer being used
, and tell me the changes needed. If Adobe REALLY wanted to do it right, that program would make necessary changes "FOR US"! But, *WILL* THEY? Knowing Adobe, I DOUBT it.
If changes need to be made, it simply tells me what they are & give me links to accomplish all of it?
IS THAT SO DIFFICULT? -
I have Photoshop Eleent 12 and use a Windows PC. I hae been using a Canon EOS 50D for several years, which uses a Compact Flash Card. I have always downloaded pictures by using a card reader wich I connect to my computer. I Go to the Organizer, click on "Import" and select "From camera or card reader". Once on the Photo Downloader, I select the pictures, chose the folder and click on "Get Media" and all the photos get downloaded. Today I folled the same procedure as always, but ZI'm gettig an error message that reads"Import Failed" followed by another message that reads "Nothing was imported. The file(s) or folder(s) selected to import did not contain any supported file types, or the files are already in this Catalog." I'm puzzled by this message and don't know what to do o get my photos. Any suggestions?
The organizer doesn't care where you send your photos when you download them via the downloader or where they happen to be when you first bring them in if you use the Get Photos command, but once your pics are in the Organizer, you *must* move them from within organizer or it can't find them. You don't have to use My Pictures at all if you don't want to, but regardless of the folder where you put your photos, if you want them someplace else, you use organizer to do it.
-
UTF-8, Unicode, XML and windows problems
Hi there,
I'm developing an application which uses a lot of russian text.
This russian text is stored in XML and can be sent to a server remotly
I use the standard javax.xml libaries to parse the xml files and DBunits XMLWriter to write generate XML strings.
The XML returned by the DBunit stuff is UTF-8, but its inside a UTF-16 string.
So when I generate xml and print it out I get something that looks like the following:
��������� ������������ ���������?����Thats ok, beacause I can stick that streight into a file when writing files and it works.
But the problem comes when sending the XML over the server.
The sending implentation I use must be able to send java generated utf-16 and xml read utf-8.
So I convert the XML from utf-8 to utf-16, using the following:
byte[] stringBytesISO = isoString.getBytes("ISO-8859-1");
utf8String = new String(stringBytesISO, "UTF-8");And that works perfectly on my linux system.
However when I run it on windows, it only seems to convert some of the characters
Привычным �?ном за�?нут дороги до ве�?ны,Does anyone know whats going wrong here?jammers1987 wrote:
I use the standard javax.xml libaries to parse the xml files and DBunits XMLWriter to write generate XML strings.DbUnit is a testing tool; are you saying you're using it in a production system? Ideally, you should use the same library to write the XML as you do to read it, but you definitely shouldn't be using DbUnit in this context.
The XML returned by the DBunit stuff is UTF-8, but its inside a UTF-16 string. That should never happen. XML is just text, and text can either be in the form of a Java string, or it can be stored externally using a text encoding like UTF-8. Never mind that Java strings use the UTF-16 encoding; you don't need to know or mention that. Encodings only come into play when you're communicating with something outside your program, like a file system or a database.
When you generate the XML, you specify that the encoding is UTF-8. When you read the XML, you specify that the encoding is UTF-8. That's all. -
hi all
It would be appreciated if any one let me know how to edit
bitmap which is imported in flash using xml and save the edited
bitmap back to xml in flash.
Is it posible to save the bitmap data in flash?
thanks in advanceYes you can... but like I said before you need to upload the
data from the changes you make to a server.
In terms of the solution... its unlikely that you'll find one
specifically for your needs. You will have to learn whatever you
don't know how already and maybe adapt some existing examples to
your needs.
To change the visual state of a movie clip... you just do all
the regular things that you want to do to it using flash... scale,
rotation, drawing API , textfields etc in actionscript. If you
don't know how to how to do that stuff, then you need to learn that
first. That's basic actionscript.
You can capture the visual state of a movieclip using the
BitmapData class. That includes a loaded jpeg. You can also
manipulate bimatp data using the same class. You should read up on
that if you don't know how to use it or check out the examples
below for uploading info.
For uploading to the server:
Here's an as2 solution that took 15 secs to find using
google:
http://www.quasimondo.com/archives/000645.php
If you're using as3, google search for "jpeg encoder as3" and
look through that info. There are also historical answers in the
forums here related to this type of thing that might help as
well.
Maybe you are looking for
-
I'm installing Mozilla Firefox 4.0 as an upgrade
-
IPhone OS 3.1.1 Update - When?
Does anyone know when Apple is planning to release a 3.1.1 update for iPhones? It seems like an unusually large number of people are experiencing major problems with version 3.1 and it's been almost a month now with no fixes from Apple. This is very
-
How can we create a table of type integer in MDM. (what the code should be?) When I create a table, it only allows type Text. Thanks
-
One Macbook Air, multiple shares displaying in Finder?
Since installing Yosemite the Shared area of the Finder sidebar is now showing not only my Airport Extreme USB HD, but is also displaying my Macbook Air (named GSB). Okay, whatever. But it's also racking up multiples over time so I have GSB (2), GSB
-
login as: oracle [email protected]'s password: Access denied [email protected]'s password: Last login: Wed Sep 5 15:10:07 2007 [oracle@db ~]$ sqlplus SQL*Plus: Release 10.2.0.1.0 - Production on Wed Sep 5 15:35:42 2007 Copyright (c) 1982, 2005, Oracl