Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 28th, 2003, 10:59 AM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 8
Flash links loading pages from cache

I have a page with a Flash movie on it. In the flash movie there are some links. One of the links points to a ColdFusion page that is producing some dynamic output. There is also a normal HTML link to that ColdFusion page on the same page the Flash movie is on. When I click the link in the Flash movie, it loads the page from the cache, but when I click the HTML link it makes a new request to the server, allowing my dynamic output to be generated correctly.

I'm using IE 5 Win.

What gives? Why is a link to the same URL loading the page from cache when clicked in the Flash movie, but correctly requesting it from the server when clicked in the HTML? How do I fix it?

Reply With Quote
  #2  
Old January 28th, 2003, 11:08 AM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 8
I think I see what's going on here -- Flash is basically (or exactly?) using the same model as JavaScript to trigger a location change in the browser, right?

Reply With Quote
  #3  
Old January 28th, 2003, 02:05 PM
VAYKENT VAYKENT is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Provo
Posts: 36 VAYKENT User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I'd want to see the Flash code.. but Flash treats a link the same as anything else....

You do have the options in Flash to load in a different frame/window... bu tnothing like - 'load from cache'.

If you have a link in Flash and you want to make sure that it is always loaded from the server, and never from the chache... you just append some random variable to the URL...

Code:
getURL("myscript.cfm?s="+ (new Date().getTime()));

Reply With Quote
  #4  
Old January 28th, 2003, 09:37 PM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 8
But not everything "else" operates in the same way. For example, JavaScript code which assigns to window.location does not work the same way that clicking a link created with HTML markup does. I've had problems in the past with cached pages being loaded when they shouldn't be when activating a link created with JavaScript.

I understand the concept of the example you gave, but that's a hack. Caching is an aspect of HTTP and is supposed to be governed by cache control headers. The way that the browser (in this case IE 5 Win) implements JavaScript, and apparently Flash (Flash is actually scripted with JavaScript, right?), with respect to assignment to window.location, or whatever is fundamentally happening, is flawed. Assigning to window.location should initiate the exact same behavior in the browser that clicking an HTML link does. But it doesn't. Hence my situation where clicking the Flash link spuriously loads the cached page and clicking the HTML link causes the browser to correctly evaluate the caching status of the page and request it from the server.

In my case, the whole idea was to avoid having to edit the link in the Flash file.

Reply With Quote
  #5  
Old January 29th, 2003, 02:32 AM
VAYKENT VAYKENT is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Provo
Posts: 36 VAYKENT User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Yeah - it's a 'hack', but Flash has no other way of manually loading 'outside' of the cache.

Sorry it didn't work for ya...

Flash is actually not ~scripted~ with JavaScript.. but ActionScript is ECMA262 compliant (for the most part), so if you're familiar with JS then you'll be comfortable in AS... and vice versa.

Reply With Quote
  #6  
Old January 30th, 2003, 09:14 PM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 8
Don't think I don't appreciate the suggestion, or that that is the SOP for Flash links.

Yeah, yeah, my bad. I thought I read at some point that Flash's scripting language had been replaced by JavaScript -- maybe it was some other app, or I misinterpreted or misremembered what I read. I actually found a good article on the O'Reilly website that outlined the relationship between JavaScript and ActionScript.

To make a long story short, I had a situation where I needed to make a link lead to a different page than it was currently. The link was included in HTML as well as a Flash movie throughout the website. My goal was to effectively change the link without editing all of the pages in the site (I didn't create the site, so it wasn't equipped with my Unique Data Management system) or changing the Flash file (I have done absolutely nothing in Flash). It would have worked except that, as I explained, the Flash link loaded a cached page instead of triggering processing of my ColdFusion script on the server.

Thanks for the info.

Reply With Quote
  #7  
Old January 31st, 2003, 12:22 AM
VAYKENT VAYKENT is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Provo
Posts: 36 VAYKENT User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Ehh... you do what you can.

I never thought you didn't appreciate the 'hack'.. I was agreeing with you - it's a hack. I wish MM would have given more freedom over things like that... but that'd probably make the player download bigger... and that's a no-no...

Yeah - JS and AS are both ECMA262 based... and for the most part compliant.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Flash links loading pages from cache


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway